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
strstr(3) - php
mb_strstr(3) - php
mb_strrpos(3) - php
stristr(3) - php
mb_strpos(3) - php
Similar Topics in the Unix Linux Community
Remove Line that contains specific string
using awk to extract text between two constant strings
Activate all Linux services script
Faster Line by Line String/Date Comparison of 2 Files
Need help in Shell scripting...