What is the strpos() function ?
The strpos() function searches for a concrete text within a string.
In other word we can say that strpos() function use for searching position of Text Within a String.
If text word match will found, then function will return the word position of the first match.
When text word will not found, it will return false.
you can see below example searches for the text word position:
<?php
//here call the strpos() function for searching position
echo strpos("City Anjar", "Anjar");
//search "A" posotion
echo strpos("City Anjar", "City");
//search "j" posotion
?>
The first text word position in a string is 0 not 1.
so when you will print "Anjar".
output will come:
5
and when you will print "City".
output will come:
0
0 Comment(s)