I have a sentence that contains a location eg activities New York for developers
in my array i have a list of locations
I want to check if the string contains a location from the array and if it does then echo it out
$string = 'Activities in New York for developers';
$array = array("New York","Seattle", "San Francisco");
if(0 == count(array_intersect(array_map('strtolower', explode(' ', $string)), $array))){
echo $location /*echo out location that is in the string on its own*/
} else {
/*do nothing*/
}