Skip to content

Instantly share code, notes, and snippets.

@nonbreakingspace
Created April 28, 2014 02:50
Show Gist options
  • Save nonbreakingspace/11360658 to your computer and use it in GitHub Desktop.
Save nonbreakingspace/11360658 to your computer and use it in GitHub Desktop.
Function :: strposa
function strposa($haystack, $needles=array(), $offset=0) {
$chr = array();
foreach($needles as $needle) {
$res = strpos($haystack, $needle, $offset);
if ($res !== false)
$chr[$needle] = $res;
}
if (empty($chr))
return false;
return min($chr);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment