1 回答

TA貢獻(xiàn)1998條經(jīng)驗 獲得超6個贊
那幾乎是一個 JSON 字符串,所以把它變成一個并從那里輕松運行
$nearlyJson = "['x','y','z',['a'],[],[['name','2'],['name','40']]]";
$nowItsJson = str_replace("'", '"', $nearlyJson );
$NowItsAPHPArray = json_decode($nowItsJson );
print_r($NowItsAPHPArray );
結(jié)果
Array
(
[0] => x
[1] => y
[2] => z
[3] => Array
(
[0] => a
)
[4] => Array
(
)
[5] => Array
(
[0] => Array
(
[0] => name
[1] => 2
)
[1] => Array
(
[0] => name
[1] => 40
)
)
)
- 1 回答
- 0 關(guān)注
- 143 瀏覽
添加回答
舉報