我有一个JSONArray,如下所示
{
"output": [
"a",
"b",
"c",
"d",
"e"
]
}
我需要找到php中的上述数组中是否存在“e”。有人可以帮我解决这个问题吗?
答案 0 :(得分:12)
$array = json_decode($json, true);
if (in_array('e', $array['output'])) {
...
}