我有一种格式的字符串变量:
""
我如何从中获得价值
$array = '[{"name":"jack","address":"who knows"},{"name":"jill","address":"who knows too"}]';
答案 0 :(得分:0)
https://juderosario.com/2016/09/01/parsing-json-with-php/
好吧,我从那里得到
$json = '[ {"id":"1", "name":"foo" }, {"id":"2", "name":"bar" } ]';
$baz = json_decode($json,true);
echo($baz[1]['name']); //bar