How to handle daylight savings time in PHP

By Josh Sherman
2 min read
development
php

If you’ve ever dealt with time in PHP you’ve probably been burnt by daylight savings time before (quite possibly yesterday ;). I’ve been there, waking up on the Sunday of the time change with an email about timestamps being an hour off or some other anomaly that ends up being […]

Split an array into chunks with PHP

By Josh Sherman
5 min read
development
php

Array chunking is a great way to paginate large arrays and as I found out recently, makes it very easy to map a large array from Redis (by way of mget and/or pipelining) back to the original data. Chunking an array is the process of taking an array and splitting […]

Were termites the least of our problems?

By Josh Sherman
7 min read
reviews

I’m definitely starting to think so at this point. If you’re not aware, last week our house was tented for termites and we took a mini vacation to New Orleans. What most don’t know is that this tenting was over a year in the making. Let’s back it up to […]

Shuffle an associative array with PHP

By Josh Sherman
1 min read
development
php

PHP makes it really easy to randomize the order of an array with the shuffle() function. If you’ve ever used this function on an associative array you know that the array will be randomized, but the keys will be dropped. It takes a bit more work, but you can randomize […]