Items tagged PHP

Recently I had to investigate a strange bug that only happened on our pre-production environment. Code that was fine all through our other development and test environments was causing a white screen of death on the home page. Not good. We’re a big team, and we have quite a strict code review process, so in theory no code should get into the main branch unless it’s had at least two pairs of eyes on it, and nothing should get through to pre-production unless it's been tested in two other shared environments, plus the developer's local machine.
Here's something I picked up from the designers at Catch Digital. When showing site mockups to a client, they would create a directory of images, and build a series of simple HTML pages, each one linking to the next. This allows the clients to click through each mockup and easily see all the designs. The last mockup links back to the directory.
Here is how to build a set of timezone clocks using PHP, jQuery and CSS3. It’s based heavily on Toby Pitman’s example, and even uses his images. I’ve added the extra timezones using a PHP array. In theory it would be possible to do it all in Javascript, but PHP is good at handling dates, and there’s no need to do any horrible maths with timezone offsets. Just tell the server which timezone you are interested in.