Detailed explanation of php string function strripos() example

怪我咯
Release: 2023-03-08 06:46:01
Original
3200 people have browsed it

The definition and syntax of php string function strripos?

php strripos() function is to find the last occurrence of a string in another string. This function is not case-sensitive. Its related functions are:

  • stripos() - Find the first occurrence of a string in another string (not case sensitive)

  • strpos() - Find the first occurrence of a string in another string (case sensitive)

  • strrpos() - Find the last occurrence of a string in another string (case sensitive)

php strripos() function syntax

strripos(string,find,start)
Copy after login

This function has three parameters, the first two parameters are required, and the third parameter is optional

Required. Specifies the string to be searched for. Required. Specifies the characters to search for. Optional. Specifies the location from which to start the search.
Parameter Description
##string
find
start

php strripos() function return value

strripos() function

returns a string in another string The position of the last occurrence in , or FALSE if the string is not found. The string position starts from 0, not from 1.

php strripos() function example

Use the php strripos() function to find the last occurrence of "php" in the string. The code is as follows:

<?php
echo strripos("You love php, I love php too!","PHP");
?>
Copy after login
The code runs the browser output result:

Detailed explanation of php string function strripos() example

[Related article recommendations]

##php The definition and usage of string function stripos()

php strpos() function example detailed explanation

Detailed explanation of string function strrpos()

The above is the detailed content of Detailed explanation of php string function strripos() example. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!