[nycphp-talk] What json library do you use?

Cliff Hirsch cliff at
Wed Aug 8 11:52:29 EDT 2007

On 8/8/07 11:00 AM, "Cliff Hirsch" <cliff at> wrote:
Json will be standard from php5.2 onwards. But for those of us that are a
bit behind, what json library do you recommend for development, knowing that
it will be phased out as we switch to the native php5.2 json extension?
> Best regards,
> Cliff Hirsch

Just answered my own question. Installing the json pecl extension (which is
what¹s used in PHP5.2+) is trivial. It¹s in xampp or avail as a dll
elsewhere, and you just need to add the extension to your php.ini file.

$arr = array('dog'=>1,2,3=>array(1,2,3));
echo '{"sample":'.json_encode($arr).'}';

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the talk mailing list