Home > Backend Development > PHP Tutorial > How to use php strripos function

How to use php strripos function

藏色散人
Release: 2023-04-05 06:50:02
Original
2439 people have browsed it

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.

How to use php strripos function

#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)
Copy after login

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");
?>
Copy after login

Output:

21
Copy after login

php strripos() function usage example 2

<?php
echo strripos("PHP is a good development language! I love PHP","php");
?>
Copy after login

Output:

43
Copy after login

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!

Related labels:
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