Home > Backend Development > PHP Tutorial > Getting Started with PHP: strrchr Example Tutorial_PHP Tutorial

Getting Started with PHP: strrchr Example Tutorial_PHP Tutorial

WBOY
Release: 2016-07-20 11:00:30
Original
1111 people have browsed it

Getting started with PHP: strrchr example tutorial

Definition and usage
The strrchr() function identifies the position at which a series occurs in another string, and returns all characters starting from this position to the end of the string.

If the character cannot be found, this function returns FALSE.

Grammar

strrchr(string,char)
Parameter Description
string Required. Specify search string
char Required. The specified string. If this is a number, it will seek to match the ASCII value of this number of characters

Tips and Instructions Tip: This feature is binary safe.
Example 1 echo strrchr("Hello world!","world");
?>

Output results.

world!

Let’s look at another strrchr example.

Example 2
In this example, we will search for a string with an ASCII value of "0":

echo strrchr("Hello world!",111);
?>
Output results.orld!

www.111cn.cn/phper/php.html


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445516.htmlTechArticlephp Getting Started: strrchr Example Tutorial Definition and Usage The strrchr () function identifies the position of a series of events that occur on another string and returns all characters starting from this position and ending with...
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