Here is a json tree.
[
{"name":"foo"},
{"name":"bar"},
{"name":"Hello"}
]
How to put one word into a json tree, to match if the word exist? like this:
$word = 'foo'; //'title'
if(...){
//if 'foo' is exist in the json tree, do some stuff
} else{
//if 'title' is not exist in the json tree, do something here
}
One way: