Hướng dẫn php json extension windows
There are no user contributed notes for this page. (PHP 5 >= 5.2.0, PHP 7, PHP 8, PECL json >= 1.2.0) json_encode — Returns
the JSON representation of a value json_encode(mixed If a value to be serialized is an object, then by default only publicly visible properties will be included. Alternatively, a class may
implement JsonSerializable to control how its values are serialized to JSON. The encoding is affected by the supplied The All string data must be UTF-8 encoded. Note: PHP implements a superset of JSON as specified in the original
» RFC 7159. Bitmask consisting of Set the maximum depth. Must be greater than zero. Returns a JSON encoded string on success or Example #1 A json_encode() example The above example will output: Example #2 A json_encode() example showing some flags in use echo echo echo The above example will output: Example #3 JSON_NUMERIC_CHECK option example The above
example will output something similar to: Example #4 Sequential versus non-sequential array example echo The above example will output: Sequential array array(4) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(3) "baz" [3]=> string(5) "blong" } string(27) "["foo","bar","baz","blong"]" Non-sequential array array(4) { [1]=> string(3) "foo" [2]=> string(3) "bar" [3]=> string(3) "baz" [4]=> string(5) "blong" } string(43) "{"1":"foo","2":"bar","3":"baz","4":"blong"}" Sequential array with one key unset array(3) { [0]=> string(3) "foo" [2]=> string(3) "baz" [3]=> string(5) "blong" } string(33) "{"0":"foo","2":"baz","3":"blong"}" Example #5
The above example will output: string(4) "12.0" string(2) "12" Notes
See Also
bohwaz ¶ 10 years ago
DimeCadmium ¶ 7 months ago
ryan at ryanparman dot com ¶ 12 years ago
Nick ¶ 6 years ago
guilhenfsu at gmail dot com ¶ 9 years ago
ck at ergovia dot de ¶ 9 years ago
Walter Tross ¶ 6 years ago
Istratov Vadim ¶ 13 years ago
jakepucan at gmail dot com ¶ 1 year ago
Sam Barnum ¶ 13 years ago
spam.goes.in.here AT gmail.com ¶ 14 years ago
Garrett ¶ 13 years ago
pvl dot kolensikov at gmail dot com ¶ 11 years ago
__construct(){
mikko dot rantalainen at peda dot net ¶ 1 year ago
|