public static function strrpos($str, $search)
    {
        if ($offset === false) {
            # Emulate behaviour of strrpos rather than raising warning
            if (empty($str)) {
                return false;
            }
            return mb_strrpos($str, $search);
        } else {
            if (! is_int($offset)) {
                trigger_error('utf8_strrpos expects parameter 3 to be long', E_USER_WARNING);
                return false;
            }

            $str = mb_substr($str, $offset);

            if (false !== ($pos = mb_strrpos($str, $search))) {
                return $pos + $offset;
            }

            return false;
        }
    }
public static function strrpos($str, $search)
    {
        if ($offset === false) {
            # Emulate behaviour of strrpos rather than raising warning
            if (empty($str)) {
                return false;
            }
            return mb_strrpos($str, $search);
        } else {
            if (! is_int($offset)) {
                trigger_error('utf8_strrpos expects parameter 3 to be long', E_USER_WARNING);
                return false;
            }

            $str = mb_substr($str, $offset);

            if (false !== ($pos = mb_strrpos($str, $search))) {
                return $pos + $offset;
            }

            return false;
        }
    }
public static function strrpos ( $ str , $ search ) { if ( $ offset === false ) { # Emulate behaviour of strrpos rather than raising warning if ( empty ( $ str ) ) { return false ; } return mb_strrpos ( $ str , $ search ) ; } else { if ( ! is_int ( $ offset ) ) { trigger_error ( 'utf8_strrpos expects parameter 3 to be long' , E_USER_WARNING ) ; return false ; } $ str = mb_substr ( $ str , $ offset ) ; if ( false !== ( $ pos = mb_strrpos ( $ str , $ search ) ) ) { return $ pos + $ offset ; } return false ; } }
UTF-8 aware alternative to strrpos

Finds position of last occurrence of a string

@param $str - string String being examined
@param $search - string String being searced for
@return mixed Number of characters before the last match or FALSE on failure
@see http://www.php.net/strrpos
UTF - 8 aware alternative to strrpos