I have a string variable in this format:
$array = '[{"name":"jack","address":"who knows"},{"name":"jill","address":"who knows too"}]';
how can I get value from
$array[0]['name']; //value is 'jack'
I have a string variable in this format:
$array = '[{"name":"jack","address":"who knows"},{"name":"jill","address":"who knows too"}]';
how can I get value from
$array[0]['name']; //value is 'jack'
https://juderosario.com/2016/09/01/parsing-json-with-php/
ok I get it from there
$json = '[ {"id":"1", "name":"foo" }, {"id":"2", "name":"bar" } ]';
$baz = json_decode($json,true);
echo($baz[1]['name']); //bar