Monday, 29 September 2014

stripos in PHP

PHP stripos() function is utilized to returns the position of the beginning of the first instance of the string if found and otherwise it returns FALSE.

Syntax:

stripos(string,find,start)
string : Required. Specifies the string to search

find : Required. Specifies the string being searched for.

start : Optional. Specifies the position at which the search should begin.

Note : PHP stripos function is case-insensitive.

Example:

<?php
echo stripos("Good Morning","oR");
?>
Output will be:
6

0 comments:

Post a Comment