要輸出excel檔~~~@0@
意思就是~~~我要在PHP底下把JSON解譯出來~~json_decode()
$rr = '{"yyy":"321", "zzz":"123", "xxx": {"a":"1", "b":"2"} }';
$yy = json_decode($rr);
print_r($yy);
Output:
stdClass Object
(
[yyy] => 321
[zzz] => 123
[xxx] => stdClass Object
(
[a] => 1
[b] => 2
)
)
可以看出$yy已經從JSON字串變成物件了
如果要取xxx裡面的a的值
print $yy->xxx->a;
http://www.php.net/manual/en/function.json-decode.php
沒有留言:
發佈留言