Forked from vrushank-snippets/Search for a string in another string
Created
March 14, 2020 09:37
-
-
Save raihan-uddin/4472414e161d1fca11fa26ad7604463a to your computer and use it in GitHub Desktop.
PHP : Search for a string in another string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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