|
|
Tutorials » Php »
|
Topic |
What is strpos Function?
|
|
Explanation |
|
The "strpos" function is used find the position of the first occurrence of a string.
Syntax:
strpos(string,char,start)
In the above syntax "string" specifies the string to be searched, "char" specifes the
character to be searched for, "start" specifies where to begin search.
Example:
<?php
echo strpos("Hello! How Are You!","ow");
?>
Result:
8
In the above example the strpos() returns 8, as the searched character is first found at that location.
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|