Duplicating Arrays in PHP

Duplicating arrays is a pretty common task for developers. Here’s 3 ways to copy $myArray to $arrayCopy: Method 1: Reference (shallow copy) In this example, $arrayCopy becomes another reference to $myArray. Updates to $myArray also update $arrayCopy. $arrayCopy...

Interfaces in CodeIgniter

Today I found a major shortcoming of CodeIgniter. Basically, in a project I’m working on, there were a bunch of different things that a User could add to their account that would need to be approved by an AdminUser before they would appear. For fairness and ease of...

Checking the NHL results without finding out the score

If you don’t know me then this will seem to come out of nowhere. I made a thing that tells you the results of NHL games (to Brits, that’s the American/Canadian ice hockey league) without telling you the scores. Basically, I’m a fan of the Pittsburgh Penguins, but I...

Tweaking Cycle 2 to add a scrollbar (and more)

For a recent project, I needed an image gallery in JQuery. No sweat, there are hundreds of suitable plugins. My favourite is Cycle 2. It’s flexible, HTML5-friendly, and allows you to write the markup pretty much any way you like, so you don’t have to compromise on...