Posts List

An offer of help

From time to time, I see people lamenting how many sites are “stuck” on old versions of PHP. Other times, I see people dealing with poor (shared) hosting environments, manual deploys with FTP, no local testing environment, and so on. Instead of sitting back and shaking my head, I’ve decided to do something about it.

Date calculations are more complex than you think

Date and time manipulation is an area of programming that seems relatively simple on its surface, but lots of danger lurks just out of view. How hard could it possibly be to take a date/time and add 1 day to it? or 1 week? Piece of cake, right? You might do something like this: $eventTime = strtotime('2011-09-15'); //add one day to the date $newEventTime = $eventTime + (24 * 60 * 60); //expects 2011-09-16 and will USUALLY work echo date('Y-m-d', $newEventTime);

Finally, a PHP conference in Wisconsin

I’m a huge fan of php|architect: the magazine, the books, the online training and especially their conferences. Living in the Milwaukee metro area, I have a short 90 minute drive to the flagship php|tek conference they host in Chicago each year. My schedule doesn’t always allow me to attend, but I do everything I can to make it. I’m still putting into practice the things I learned at php|tek 2010 and I regularly keep in touch with the many friends I met there.

WordPress plugin for contextual dynamic text

WordPress has a concept called shortcodes. They’re very handy for inserting chunks of text or functionality with a simple text syntax. For example, one of the stock shortcodes allows you to type [gallery] in a post where you want a photo gallery to appear. But the real power is exposed when you start building your own shortcodes.