查找php中的JSONArray中是否存在值

Lal*_*h B 10 php json

我有一个JSONArray,如下所示

{
    "output": [
        "a",
        "b",
        "c",
        "d",
        "e"
    ]
}
Run Code Online (Sandbox Code Playgroud)

我需要找到php中的上述数组中是否存在"e".有人可以帮我解决这个问题吗?

dec*_*eze 12

$array = json_decode($json, true);
if (in_array('e', $array['output'])) {
    ...
}
Run Code Online (Sandbox Code Playgroud)