strpos( ) will return false (as opposed to -1) : strrpos « String « PHP
- PHP
- String
- strrpos
strpos( ) will return false (as opposed to -1)
<?
$string = "This is a strpos( ) test";
$pos = strpos($string, "This");
if ($pos = == false) {
print "Not found\n";
} else {
print "Found!\n";
}
?>
Related examples in the same category