Just found one useful function and would kike to share it. If you often use strpos, you might find this useful.
// strpos that takes an array of values to match against a string // note the stupid argument order (to match strpos) function strpos_arr($haystack, $needle) { if(!is_array($needle)) $needle = array($needle); foreach($needle as $what) { if(($pos = strpos($haystack, $what))!==false) return $pos; } return false; } ?>
This function will be useful if you need to find whether ANY element of array is presented in the source string. Else you have to either modify it, or create another one.