background preloader

PHP

Facebook Twitter

PHP Best Practices: a short, practical guide for common and confusing PHP tasks. The perfect PHP clean url generator. RegExr. How To Create A Better Meta Box In WordPress Post Editing Page. WordPress is one of the most powerful blog platforms out there. One of its strength is the ability to allow post authors to assign custom fields to a post. This arbitrary extra information is known as meta-data and can be added using the Custom Fields box under the content editor of writing post screen. The problem is that adding these meta data handy is not a good idea for most users because they have to know what are the meta key and type of its value. It’s better when developers create a custom meta box that can show which information is needed and give some explanations to users. Before we start, make sure that you theme has functions.php file. Step 1. Open the functions.php file, and put the following code into it: $prefix = 'dbt_';$meta_box = array( 'id' => 'my-meta-box', 'title' => 'Custom meta box', 'page' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'Text box', 'desc' => 'Enter something here', 'id' => $prefix .

$prefix = 'dbt_'; S Blog – PHP 5.4.3 and PHP 5.3.13 x64 (64 bit) for Windows. PHP 5.4.3 and 5.3.13 were released a week ago (May 8, 2012). The complete changelog can be found here. Below you will find 64 bit builds of PHP 5.4.3 and 5.3.13 for Windows. As usual these were compiled with Visual C++ 2008 (VC9). Some of you were experiencing crashes with the 5.4.0 build that I posted last month. Let me know if the crashes still occur with the new 5.4.3 (thread safe) build. Download PHP 5.4.3 (Thread Safe) php-5.4.3-Win32-VC9-x64.zip (Mirror 1) (Mirror 2) PHP 5.4.3 (Non Thread Safe) php-5.4.3-nts-Win32-VC9-x64.zip (Mirror 1) (Mirror 2) PHP 5.3.13 (Thread Safe) php-5.3.13-Win32-VC9-x64.zip (Mirror 1) (Mirror 2) PHP 5.3.13 (Non Thread Safe) php-5.3.13-nts-Win32-VC9-x64.zip (Mirror 1) (Mirror 2) Additional Extensions Additional extensions can be found in the following mediafire folder – I will be compiling and uploading updated versions of extensions for both PHP 5.4 and 5.3 during this week.

Fixed curl extensions: Related Posts: Coding Horror: The PHP Singularity. Look at this incredible thing Ian Baker created. Look at it! What you're seeing is not Photoshopped. This is an actual photo of a real world, honest to God double-clawed hammer. Such a thing exists. Isn't that amazing? And also, perhaps, a little disturbing? That wondrous hammer is a delightful real-world acknowledgement of the epic blog entry PHP: A Fractal of Bad Design.

I can’t even say what’s wrong with PHP, because – okay. Remember the immediate visceral reaction you had to the double-clawed hammer? This has been going on for years. I'm no language elitist, but language design is hard. Except now it's 2012, and fellow programmers are still writing long screeds bemoaning the awfulness of PHP! What's depressing is not that PHP is horribly designed. I used to think that PHP was the biggest, stinkiest dump that the computer industry had taken on my life in a decade. Is PHP so broken as to be unworkable? The hammer metaphor is apt, because at its core, this is about proper tooling. PHP is much better than you think. Rants about PHP are everywhere, and they even come from smart guys. When Jeff Atwood wrote yet another rant about PHP, it made me think about the good parts of PHP. The biggest problem of these rants is that they come from people stuck in the old days of PHP.

They either don't care or they don't want to admit that PHP actually evolves at a very fast pace, both at the language level but also at the community level. In fact, it evolves much faster than any other language or web platform. It has not always been the case, but the last 5 years have been an amazing journey for PHP. Before talking about the amazing things the PHP community has achieved recently, let's have a look at some interesting numbers: PHP is used by 77.9% of all the websites whose server-side programming language is known.

PHP must have done something right, no? PHP, the Language PHP 5.0 (released in 2004) brought us a very solid object model... wait a minute, I'm talking about something released almost 8 years ago. Git.