strrchr(3) php man page | unix.com

Man Page: strrchr

Operating Environment: php

Section: 3

STRRCHR(3)								 1								STRRCHR(3)

strrchr - Find the last occurrence of a character in a string

SYNOPSIS
string strrchr (string $haystack, mixed $needle)
DESCRIPTION
This function returns the portion of $haystack which starts at the last occurrence of $needle and goes until the end of $haystack.
PARAMETERS
o $haystack - The string to search in o $needle - If $needle contains more than one character, only the first is used. This behavior is different from that of strstr(3). If $needle is not a string, it is converted to an integer and applied as the ordinal value of a character.
RETURN VALUES
This function returns the portion of string, or FALSE if $needle is not found.
CHANGELOG
+--------+------------------------------------+ |Version | | | | | | | Description | | | | +--------+------------------------------------+ | 4.3.0 | | | | | | | This function is now binary safe. | | | | +--------+------------------------------------+
EXAMPLES
Example #1 strrchr(3) example <?php // get last directory in $PATH $dir = substr(strrchr($PATH, ":"), 1); // get everything after last newline $text = "Line 1 Line 2 Line 3"; $last = substr(strrchr($text, 10), 1 ); ?>
NOTES
Note This function is binary-safe.
SEE ALSO
strstr(3), strrpos(3). PHP Documentation Group STRRCHR(3)
Related Man Pages
strripos(3) - php
mb_strrpos(3) - php
grapheme_strstr(3) - php
iconv_strpos(3) - php
mb_stristr(3) - php
Similar Topics in the Unix Linux Community
using awk to extract text between two constant strings
Activate all Linux services script
Need help for Cut Command
Is it possible to index substr from right to left?
Need help in Shell scripting...