Home >Backend Development >PHP Tutorial >How to use php strripos function
PHP strripos() function is used to calculate the position of the last occurrence of the specified string in the target string (not case-sensitive). Its syntax is strripos(string,find,start). The parameter string is required and refers to the specified string. The search string; required by find, refers to specifying the characters to be found.
#php How to use strripos function?
php strripos() function syntax
Function: Find the last occurrence of a character in a string, case-insensitive
Syntax:
strripos(string,find,start)
Parameters:
string required. Specifies the string to be searched for.
findRequired. Specifies the characters to search for.
start is optional. Specifies where to start the search.
Description:
Find the last occurrence of a string in another string. The strripos() function is not case sensitive.
php strripos() function usage example 1
<?php echo strripos("You love php, I love php too!","PHP"); ?>
Output:
21
php strripos() function usage example 2
<?php echo strripos("PHP is a good development language! I love PHP","php"); ?>
Output:
43
This article is an introduction to the PHP strripos function. I hope it will be helpful to friends in need!
The above is the detailed content of How to use php strripos function. For more information, please follow other related articles on the PHP Chinese website!