PHP strpos() Function


The strpos() function is used to find the position of the first occurrence of a string inside another string.

Syntax
strpos(string,find,start)
Parameters
  • string - (required) Specify the string to check.
  • find - (required) Specify the string to find.
  • start - (optional) Specify where to begin the search..
Example
<?php
    echo strpos("Welcome to My Home","Home");
?> 
 

Output

14

Prev Next