What PHP Function is used to find position of a string?
PHP strpos() function is used to find the first occurrence of substring in the given string.
echo strpos("The color of apple is red.","apple");
The word ‘apple’ is found at the position ’13’. Remember that the position of string/character start at 0, and not 1. This function is very useful to find certain patterns or words in a string.