PHP stripos Function

What is stripos Function and how it is used in string?


In PHP,This function is used to find position of first occurrence of a case-insensitive string.



In the above syntax "haystack" is the string to be searched for "needle", "offset" specifies where to begin search.

Example :

echo stripos("Hi India!","I", "0");
Result :


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.

PHP Topics

Ask Questions

Ask Question