Reputation: 12239
I have a JSONArray as shown below
{
"output": [
"a",
"b",
"c",
"d",
"e"
]
}
I need to find if "e" exists in the above array in php. Can someone help me out with this ?
Upvotes: 12
Views: 12205
Reputation: 522075
$array = json_decode($json, true);
if (in_array('e', $array['output'])) {
...
}
Upvotes: 16