Skip to content

Instantly share code, notes, and snippets.

@matid
Created March 30, 2009 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matid/87892 to your computer and use it in GitHub Desktop.
Save matid/87892 to your computer and use it in GitHub Desktop.
<?php
$array = array('abc', 'def');
$string = "String with 'abc' or 'def' in it";
function find($string, $array){
foreach($array as $token){
if(strpos($string, $token) !== false){
return true;
}
}
return false;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment