php tutorial - PHP strpos Function - php programming - learn php - php code - php script



  • The String position - strpos function is used to locate and return the position of a character(s) within the string.

Sphp script Syntax :

strpos(string,find,start);
click below button to copy the code. php tutorial - team

  • The first argument defines the text.
  • Second argument finds where the particular text is in the string.
  • Third argument is optional that defines where to begin the search.

php 7 Sample Code : sample php program

<!DOCTYPE html>
<html>
    <body>
        <?php
            echo strpos('welcome to wikitechy', 'wikitechy');
        ?>
    </body>
</html>
click below button to copy the code. php tutorial - team

php programmer Code Explanation :

Code Explanation for strpos Function In PHP

  1. In this example we use the string positon function the first parameter define the content “welcome to wikitechy” and the second parameter is positon of the finding the content as “wikitechy”.

php development Sample Output :

output for strpos Function In PHP

  1. Output -> we have shown the string position function, where we found that “Wikitechy” is appearing after the 11th position in the given statement “welcome to wikitechy “.


Related Searches to php strpos function