check if string contains substring php

PHP
$myString = 'Hello Bob how are you?';
if (strpos($myString, 'Bob') !== false) {
    echo "My string contains Bob";
}$a = 'How are you?';

if (strpos($a, 'are') !== false) {
    echo 'true';
}if (strpos($string, 'substring') !== false) {
	// do stuff 
}$result = strpos("haystack", "needle");

if ($result != false)
{
  // text found
}$mystring = 'abc';
$findme   = 'a';
$pos = strpos($mystring, $findme);// returns true if $needle is a substring of $haystack
function contains($haystack, $needle){
    return strpos($haystack, $needle) !== false;
}
Source

Also in PHP: