check if string contains character 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';
}$a = 'Hello world?';

if (strpos($a, 'Hello') !== false) { //PAY ATTENTION TO !==, not !=
    echo 'true';
}
if (stripos($a, 'HELLO') !== false) { //Case insensitive
    echo 'true';
}// returns true if $needle is a substring of $haystack
function contains($haystack, $needle){
    return strpos($haystack, $needle) !== false;
}$a = 'How are you?';

if (strpos($a, 'are') !== false) {
    echo 'true';
}
$haystack = 'This is my haystack that we shall check'
$has_A = strpos($haystack, 'A') !== false;
$has_a = strpos($haystack, 'a') !== false;

Source

Also in PHP: