September 2001
Intermediate to advanced
768 pages
32h 45m
English
int strrpos(string string, string character)
Finds the last position at which a character occurs within a string.
Returns:
Integer; FALSE if the character cannot be found in the string
Description:
strrpos() returns the position of the last occurrence of character within string .
If character is not found, the function returns FALSE.
If the character parameter is not a string, it’s converted to an integer. The resulting integer is used as the ordinal value of a character.
Version:
PHP 3+, PHP 4+
See also:
Other functions that find characters within strings:
substr() strchr() stristr() strpos() strstr()
Example:
<?php
$text = "It's darkest before the dawn.";
echo strrpos ($text, 'a');
?>
Output: ... |
Read now
Unlock full access