I need to make something that will check a strings for any instances of words from a list, but I'm not really sure where to start. I see that I could use strstr for a single word, but I have a few words that I will need to look for so I'm not sure how to do that. Any help here would be greatly appreciated
with strstr you can find first occurrence of an word in a given string , it's not accepting a list of words. you can try <? $string_to_check = "some string"; $list_of_words = array('word1', 'word2'); forearch ($list_of_words as $word) { if (preg_match("/".$word."/", $string_to_check)) { echo $word . " found"; } else { echo $word . "not found"; } } ?> PHP: you can try some variations of this simple code. happy phping...