$a = 'Hello world?'; if (strpos($a, 'Hello') !== false) { //PAY ATTENTION TO !==, not != echo 'true'; } if (stripos($a, 'HELLO') !== false) { //Case insensitive echo 'true'; }