PHP » GoLang |
login |
register |
about
|
strrpos(PHP 4, PHP 5, PHP 7) strrpos — Find the position of the last occurrence of a substring in a string Description
int strrpos
( string
$haystack
, string $needle
[, int $offset = 0
] )
Find the numeric position of the last occurrence of
Parameters
Return Values
Returns the position where the needle exists relative to the beginning of
the
Returns Warning
This function may
return Boolean Changelog
Examples
Example #1 Checking if a needle is in the haystack It is easy to mistake the return values for "character found at position 0" and "character not found". Here's how to detect the difference:
<?php
Example #2 Searching with offsets
<?php See Also
|
more
Recently updated
more
Most requested
more
Last requests
|