I have a JSON array
{
\"people\":[
{
\"id\": \"8080\",
\"content\": \"foo\"
},
{
\"id\": \"8097\",
\"content\": \"ba
json_decode() it and treat like any other array or StdClass object
$arr = json_decode('{
"people":[
{
"id": "8080",
"content": "foo"
},
{
"id": "8097",
"content": "bar"
}
]
}',true);
$results = array_filter($arr['people'], function($people) {
return $people['id'] == 8097;
});
var_dump($results);
/*
array(1) {
[1]=>
array(2) {
["id"]=>
string(4) "8097"
["content"]=>
string(3) "bar"
}
}
*/