php-src/ext/json
2008-11-17 11:28:01 +00:00
..
tests - New test 2008-10-02 03:36:52 +00:00
config.m4 MFH: Fix some configure --help texts 2007-07-03 17:25:43 +00:00
config.w32 MFH: enable by default 2006-07-22 15:33:02 +00:00
CREDITS MFH 2006-07-20 10:07:29 +00:00
JSON_parser.c We can afford a larger stack here and other json parsers out there 2008-07-30 13:52:59 +00:00
JSON_parser.h
json.c - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-11-17 11:28:01 +00:00
json.dsp
package.xml
php_json.h MFH: unused stuff 2008-07-22 14:57:46 +00:00
README
utf8_decode.c
utf8_decode.h
utf8_to_utf16.c fix #43941: invalid utf-8 not accepted 2008-01-30 03:17:57 +00:00
utf8_to_utf16.h

json 1.2.0
==========

This extension implements the JavaScript Object Notation (JSON)
data-interchange format as specified in [0].

Two functions are implemented: encoding and decoding. The decoding
is handled by a parser based on JSON_checker[1] by Douglas Crockford.


Function overview
-----------------

    string json_encode ( mixed value )

json_encode returns a string containing the JSON representation of value.
value can be any type except a resource.

    mixed json_decode ( string json, [bool assoc] )

json_decode takes a JSON string and converts it into a PHP variable.
When assoc is given, and evaluates to TRUE, json_decode() will return
any objects as associative arrays.


Example usage
-------------

$arr = array("a"=>1,"b"=>2,"c"=>3,"d"=>4,"e"=>5);
echo json_encode($arr);

---> {"a":1,"b":2,"c":3,"d":4,"e":5}

$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}';
var_dump(json_decode($json));

---> object(stdClass)#1 (5) {
        ["a"]=>
        int(1)
        ["b"]=>
        int(2)
        ["c"]=>
        int(3)
        ["d"]=>
        int(4)
        ["e"]=>
        int(5)
     }

$json = '{"a":1,"b":2,"c":3,"d":4,"e":5}';
var_dump(json_decode($json, true));

---> array(5) {
        ["a"]=>
        int(1)
        ["b"]=>
        int(2)
        ["c"]=>
        int(3)
        ["d"]=>
        int(4)
        ["e"]=>
        int(5)
     }


Authors
-------

Omar Kilani <omar@php.net>


---

[0] http://www.crockford.com/JSON/draft-jsonorg-json-00.txt
[1] http://www.crockford.com/JSON/JSON_checker/