JSON-PHP / january 2005
eval("var decoded_data = "+encoded_data);
With JSON-PHP, it can be almost as easy on the server-side, too:
// create a new instance of Services_JSON
$json = new Services_JSON();
// convert a complex value to JSON notation
$value = array(1, 2, 'foo');
$output = $json->encode($value);
// accept incoming POST data
$input = $GLOBALS['HTTP_RAW_POST_DATA'];
$value = $json->decode($input);
JSON-PHP is available in fully-functional proposal form from the PEAR site, under the PHP license.
If you're comfortable with compiling PHP extensions from source, and have root privileges on the machines you use, there is a C implementation of JSON for PHP available, with big speed advantages over JSON-PHP.