Borgar.net

— Go straight to page navigation

15. June 2008

JSON for old PHP installations

I use PHP a lot. Mostly to work with existing products, or to create mockups of things that will get replaced with something else later.

The great thing about PHP is that it is present in some form on nearly all servers. If you're careful to avoid version 5 features then you can pretty much expect your code to run wherever.

For a recent prototype I needed JSON (which wasn't introduced to PHP until version 5) on a 4.3 system. Being a relentless do-it-yourself'er I have written a tiny JSON functionality "library" for older versions of PHP.

It's about 5k of mostly comments. Available under MIT licence from Google code. Have fun.

Published: 15. June 2008. Tagged: , , , .