Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vrushank-snippets/2169610 to your computer and use it in GitHub Desktop.
Save vrushank-snippets/2169610 to your computer and use it in GitHub Desktop.
PHP : Search for a string in another string
function contains($str, $content, $ignorecase=true){
if ($ignorecase){
$str = strtolower($str);
$content = strtolower($content);
}
return strpos($content,$str) ? true : false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment