Even more:
if you want to check if a sequence of characters are in a string, the position may be zero i.e. from the start which can be evaluated as false, so in PHP and I suspect other programming languages you should use 3 equals signs (exactly equal to) such as:
PHP Code:
$s = "Hello World";
if (strpos($s, 'Hello') === 0) echo "Found"; else echo "Not found";
The opposite comparison operator is !==
PHP Code:
$s = "Hello World";
if (strpos($s, 'Hello') !== false) echo "Found"; else echo "Not found";
Bookmarks