(no version information, might be only in CVS)
?ュ??涓?JSON ?煎????绗?覆骞朵????杞??涓?PHP ???
json
寰?В??? json string ?煎????绗?覆??
assoc
褰?????涓?TRUE ?讹?灏????array ??? object ??
Returns an object or if the optional assoc parameter is TRUE, an associative array is instead returned.
例 1. json_decode() ???瀛?/title> [1]
<?php $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; var_dump(json_decode($json)); var_dump(json_decode($json, true)); ?>
上例将输出:
object(stdClass)#1 (5) { ["a"] => int(1) ["b"] => int(2) ["c"] => int(3) ["d"] => int(4) ["e"] => int(5) } array(5) { ["a"] => int(1) ["b"] => int(2) ["c"] => int(3) ["d"] => int(4) ["e"] => int(5) }