I want to compare a variable called $value to items in a multidimensional array called $listofplaces. So when a user uploads a file I can validate it and see if it matches exactly to what’s in my array.
My $lisofplaces Array looks like this when printed (I haven’t added all the places as there are many):
array(3){
[0] =>
array(18){
[“type”] => “FIELD”
…
[“values”] =>
array(50)
[1] =>
array(3) {
[“name”] => “Paris”
…}
[2] =>
array(3) {
[“name”] => “London”
…}
}
}
my method to compare my variable to the array
if(strpos($value, $listofplaces) !== false){
echo ‘found’;} else{ echo ‘not found’;}
However this isn’t working and I don’t understand why please help: Also I know the quotation marks are wrong I am doing this off my iPad