php man page for strrchr

Query: strrchr

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

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
mb_strripos(3) - php
stristr(3) - php
iconv_strpos(3) - php
mb_stripos(3) - php
mb_stristr(3) - php
Similar Topics in the Unix Linux Community
Remove blank lines
Perl conversion &amp; perldoc question
Activate all Linux services script
File parsing in Unix
Need help in Shell scripting...