|
|
Tutorials » Php »
|
Topic |
What is stripos Function and how it is used in string?
|
|
Explanation |
|
In PHP,This function is used to find position of first occurrence of a case-insensitive string.
Syntax:
stripos(haystack,needle,offset)
In the above syntax "haystack" is the string to be searched for "needle", "offset" specifies where to begin search.
Example:
<?php
echo stripos("Hi India!","I", "0");
?>
Result:
3
In the above example the "I" is searched in the string from the offset "o" since "I" is at the "3"rd postion its displayed.
|
|
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.
|
|
|
|