I need to be able to evaluate URL and see if words, like "google", "yahoo" or "bing" are a part of that URL. Normally I would create an array with these words to match and run a loop, however in the code that I work with I need to add just another if/else line to existing code. What is the best way to do it.
URLs can be
google.com
google.co.uk
google.co.in etc. I suppose I need to match "google."?
Currently I came up with the following but feel it is a very inefficient way:
$srchEng = array("bing.com", "google.com", "google.co.uk", "yahoo.com");
...
} elseif (in_array($url, $searchEng)) {