Using the json_encode_php Tutorial in PHP

Source: Internet
Author: User
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 ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.