Previous | Home | Next |
stripos()
The stripos() function finds the position of the first occurrence of a string inside another string. stripos() function is case-insensitive.
Syntax:stripos(string,find,start)
Example:
<?php echo stripos("Hello India..!!, Gud Morning","Morning"); ?>
Output:
strpos()
The strpos() function finds the position of the first occurrence of a string inside another string. strpos() function is case-sensitive.
Syntax:strpos(string,find,start)
Example:
<?php echo strpos("Gud Morning...!!, Gud morning India","morning"); ?>
Output:
strripos()
The strripos() function finds the position of the last occurrence of a string inside another string.
Syntax:strripos(string,find,start)
In above syntax, "string" specifies the string to search, "find" specifies the string to find and "start" specifies where to begin the search.
Example:
<?php echo strripos("Hello India..!!, Gud Morning","Morning"); ?>
Output:
strrpos()
The strrpos() function finds the position of the last occurrence of a string inside another string.
Syntax:strrpos(string,find,start)
In above syntax, "string" specifies the string to search, "find" specifies the string to find and "start" specifies where to begin the search.
Example:
<?php echo strrpos("Gud Morning...!!, Gud morning India","morning"); ?>
Output:
Previous | Home | Next |