大家經(jīng)常會用到j(luò)son數(shù)據(jù),那么在php中怎樣將json格式的數(shù)據(jù)轉(zhuǎn)為數(shù)組在php中進行使用呢,接下來我進詳細講一下
//json格式數(shù)據(jù)
$data = '[{ "state": "1", "cord": "0", "err": "0",}]';
//轉(zhuǎn)換成數(shù)組
$datas = json_decode($data,true);
//輸出
var_dump($datas );
輸出就會看到變?yōu)閜hp數(shù)組格式了,接下來就可以對$datas 進行下一步處理了
上一篇: 網(wǎng)站改版:如何做到中看又中用
下一篇: php for循環(huán)用法講解
關(guān)鍵詞: