Strpos is a lot cheaper than preg_match, therefore you should do it first