Definition
The strpos() function finds the position of the first occurrence of a string(case-sensitive) inside another string.
Syntax
strpos(string, find, start)
Parameters
Parameter | Description |
---|---|
string |
Required. Specifies the string to search. |
find |
Required. Specifies the string to find. |
start |
Optional. Specifies where to begin the search. If start is a negative number, it counts from the end of the string. |
Example
<?php
echo strpos("Welcome to the PHP Tutorials! Find PHP functions here.", "PHP");