$myString = 'Hello Bob how are you?'; if (strpos($myString, 'Bob') !== false) { echo "My string contains Bob"; }
if (strpos($string, 'substring') !== false) { // do stuff }
$a = 'How are you?'; if (strpos($a, 'are') !== false) { echo 'true'; }
preg_match('/(http|ftp|mailto)/', $string, $matches); var_dump($matches);
// returns true if $needle is a substring of $haystack function contains($haystack, $needle){ return strpos($haystack, $needle) !== false; }
if(strpos($_SERVER['REQUEST_URI'], "string")) { ... }