what is the syntax of the STRPOS() function in php?
strpos(string,find,start)
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. |
examples of the STRPOS() function
Example 1. In this example, we find the position of the first occurrence of “php” inside the string.
<?php
echo strpos("I love php, I love php too!","php");
?>