PHP.nl

mb_strrpos

mb_strrpos

Find position of last occurrence of a string in a string

 **mb_strrpos** string $haystack string $needle int $offset  $encoding

Performs a multibyte safe operation based on the number of characters. position is counted from the beginning of . First character's position is 0. Second character position is 1. strrpos``needle``haystack

haystack The being checked, for the last occurrence of string``needle

needle The to find in . string``haystack

offset May be specified to begin searching an arbitrary number of characters into the . Negative values will stop searching at an arbitrary point prior to the end of the . haystack``haystack

encoding

Returns the numeric position of the last occurrence of in the . If is not found, it returns false. needle``haystack``string``needle

  • If is greater than the length of , a will be thrown. offset``haystack``ValueError

    mb_strpos``mb_internal_encoding``strrpos