I have an array of items, how do I scan a string and detect if the items in the array exist anywhere in the string. I seen other post that are similar to this question but none have worked. Maybe it is because I'm using wordpress
ex:
$string = get_the_title();// "The Man Who Wants You – Amos Lee [Vevo Official Video]" ---the string
$bads = get_the_tags();// array('Amos Lee', 'Foo Fighters', 'U2'); array of items
foreach($bads as $bad) {
$place = strpos($string, $bad);
if (!empty($place)) {
echo "True";
exit;
} else {
echo "Not True";
}
}