-
Recent Posts
Recent Comments
Archives
Categories
Meta
Tag Archives: php
Finding PHP Short Tags
There are a number of ways to escape between PHP and output (usually HTML) mode. Personally I recommend sticking with the traditional <?php style. One method that can cause problems is the so called ‘short tag’ style – <? and … Continue reading
WordCamp SF 2010 Presentation Video
From WordPress.TV. I’ll never get used to watching myself on video.
Posted in Posts
Tagged php, plugins, presentation, security, themes, video, wordcamp, wordpress
2 Comments
Utah PHP Users Group Presentation: Anatomy of a PHP Request
I’ll be presenting at the next Utah PHP Users Group (UPHPU) meeting on Anatomy of a PHP Request: Ever wondered what really happens when your PHP script runs? I’ll cover the major milestones in the life and times of a … Continue reading
Efficient PHP: Don't Abuse dirname( __FILE__ )
Every now and then I run across a chunk of PHP code at the top of a file that looks something like this: require dirname( __FILE__ ) . ‘/path/to/something.php’; require dirname( __FILE__ ) . ‘/path/to/another.php’; require dirname( __FILE__ ) . … Continue reading
PHP Tip: Spaces Are Not empty()
It can be really easy to get tripped up by PHP’s empty and isset functions. I just came across a bug in some code that was using empty() to check for something so I thought this was a good time … Continue reading
PHP Helpers: curl_http_request
cURL is one very handy program and library, I love having access to in PHP. It has a ton of options though, and I can never seem to remember to flip the right knobs without reviewing the options list. 99% … Continue reading
Database Indexes on Domain Names
As part of a separate conversation Matt suggested something I had not given much thought to before. Say you have a database column that is used to store domain names. Something as simple as `domain` varchar(255) NOT NULL. Of course … Continue reading
PHP Helpers: make_slug
New function, make_slug – if ( !function_exists( ‘make_slug’ ) ) { function make_slug( $str ) { $url_str = strtolower( trim( $str ) ); $url_str = preg_replace( ‘/[\s_]+/’, ‘-’, $url_str ); $url_str = preg_replace( ‘/-{2,}/’, ‘-’, $url_str ); $url_str = preg_replace( … Continue reading
PHP Helpers: redirect_url
New function: redirect_url if ( !function_exists( ‘redirect_url’ ) ) { function redirect_url( $url, $status = 302 ) { header( "Location: {$url}", TRUE, $status ); exit; } } A special case wrapper around the header function to do URL redirection. I … Continue reading