Json as a lightweight data interchange format, began to be pro-gaze, with an XML grab on the site of the limelight. Happily, PHP also built the function of JSON serialized data into functions, which makes it convenient for Phpcoder to use JSON.
In the ointment, Json_encode/json_decode series functions are only available in the php5.2. This makes it a headache for coder to develop a strong compatibility PHP system.
Fortunately, the JSON approach has already been encapsulated as a class that can be executed by the php4.x series or even the lower version. Thank the pioneers here first. Let us step on the shoulders of giants to succeed.
Learn more here: http://code.itlearner.com/php/JSON-class.html
How to use:
if (function_exists ("Json_encode"))
{
Return Json_encode ($phparr);
}
Else
{
Require_once ROOT. " Include/json.class.php ";
$json = new Services_json;
Return $json->encode ($phparr);
}
http://www.bkjia.com/PHPjc/371739.html www.bkjia.com true http://www.bkjia.com/PHPjc/371739.html techarticle Json as a lightweight data interchange format, began to be pro-gaze, with an XML grab on the site of the limelight. Happily, PHP also built the function of JSON serialized data into a function ...