➤ The strpos() function finds the position of the first
occurrence of a string inside another string.
Syntax:
strpos(string,find,start)
// start is optional. Specifies where to begin the search.
For instance:
// Find the position of the first occurrence of "lo" inside the string:
$string = "Hello world";
$result_string = strpos ($string,"lo");
echo $result_string;
// outputs : 3
➤ strrpos() - Finds the position of the last occurrence of a string inside another string (c-sensitive)
➤ stripos() - Finds the position of the first occurrence of a string inside another string (c-insensitive)
➤ strripos() - Finds the position of the last occurrence of a string inside another string (c-insensitive)