Returns the position of a substring.
strpos() returns the position of the first occurrence of a string within another string. An offset can optionally be used to set a position where the search should start. If no occurrence is found, FALSE is returned.
<?php
print 'Position of "world": ' . strpos("Hello world", "world") . "<br>";
if (!strpos("Hello world", "Hello", 5))
print '"Hello" not found after position 5';
?>
Position of "world": 6
"Hello" not found after position 5
This code shows how strpos() can be used both with and without the offset parameter.