January 26, 2009

SOLUTION jsonwrapper: json_encode for earlier versions of PHP 5.x

"What is this about?
PHP 5.2 adds the json_encode function, which turns almost any PHP data structure into valid JavaScript code. Hashes, arrays, arrays of hashes, whatever.

Unfortunately a lot of Linux distributions are still shipping with PHP 5.1.x.

jsonwrapper implements the json_encode function if it is missing, and leaves it alone if it is already present. So it is nicely future-compatible.

Just add:

require 'jsonwrapper.php';" boutell.com

No comments:

Post a Comment