Basically, I have an array of strings to search for. If it were only one string, stristr would work perfectly. However, since it’s an array, the only thing I can think of is to just run a foreach loop and stristr the string from each iteration.
Surely there’s a better way to do this, I just don’t know it.
Edit
For example, say I have this array:
$array = array("string1", "foo", "bar", doowop");
and this string:
$string = "aw dang man lets go to that bar";
I need to figure out if $string contains one of the strings from the array.
Well you will have to foreach through the array, as the point of the stristr function is the return value.