/** * Finds position of last occurrence of a char in a UTF-8 string. This is * a UTF8-aware version of [strrpos](http://php.net/strrpos). * * $position = UTF8::strrpos($str, $search); * * @author Harry Fuecks <*****@*****.**> * @param string haystack * @param string needle * @param integer offset from which character in haystack to start searching * @return integer position of needle * @return boolean FALSE if the needle is not found * @uses UTF8::$server_utf8 */ public static function strrpos($str, $search, $offset = 0) { if (UTF8::$server_utf8) { return mb_strrpos($str, $search, $offset, Kohana::$charset); } if (!isset(self::$called[__FUNCTION__])) { require SYSPATH . 'utf8' . DIRECTORY_SEPARATOR . __FUNCTION__ . EXT; // Function has been called self::$called[__FUNCTION__] = TRUE; } return _strrpos($str, $search, $offset); }
/** * Finds position of last occurrence of a char in a UTF-8 string. * @see http://php.net/strrpos * * @author Harry Fuecks <*****@*****.**> * * @param string haystack * @param string needle * @param integer offset from which character in haystack to start searching * @return integer position of needle * @return boolean FALSE if the needle is not found */ public static function strrpos($str, $search, $offset = 0) { if (!isset(self::$called[__FUNCTION__])) { require SYSPATH . 'core/utf8/' . __FUNCTION__ . EXT; // Function has been called self::$called[__FUNCTION__] = TRUE; } return _strrpos($str, $search, $offset); }
static function strrpos($str, $search, $offset = 0) { if (UTF8::$server_utf8) { return mb_strrpos($str, $search, $offset, JsonApiApplication::$charset); } if (!isset(UTF8::$called[__FUNCTION__])) { require JsonApiApplication::find_file("utf8", __FUNCTION__); // Function has been called UTF8::$called[__FUNCTION__] = TRUE; } return _strrpos($str, $search, $offset); }
/** * Finds position of last occurrence of a char in a UTF-8 string. * @see http://php.net/strrpos * * @author Harry Fuecks <*****@*****.**> * * @param string haystack * @param string needle * @param integer offset from which character in haystack to start searching * @return integer position of needle * @return boolean FALSE if the needle is not found */ public static function strrpos($str, $search, $offset = 0) { require_once dirname(__FILE__) . '/' . __FUNCTION__ . '.php'; return _strrpos($str, $search, $offset); }
/** * Finds position of last occurrence of a char in a UTF-8 string. This is * a UTF8-aware version of [strrpos](http://php.net/strrpos). * * $position = UTF8::strrpos($str, $search); * * @author Harry Fuecks <*****@*****.**> * @param string $str haystack * @param string $search needle * @param integer $offset offset from which character in haystack to start searching * @return integer position of needle * @return boolean FALSE if the needle is not found * @uses UTF8::$server_utf8 */ public static function strrpos($str, $search, $offset = 0) { if (UTF8::$server_utf8) { return mb_strrpos($str, $search, $offset, Kohana::$charset); } if (!isset(UTF8::$called[__FUNCTION__])) { require Kohana::find_file('utf8', __FUNCTION__); // Function has been called UTF8::$called[__FUNCTION__] = TRUE; } return _strrpos($str, $search, $offset); }
/** * Finds position of last occurrence of a char in a UTF-8 string * * This is a UTF8-aware version of [strrpos](http://php.net/strrpos). * * Example: * ~~~ * $position = UTF8::strrpos($str, $search); * ~~~ * * @author Harry Fuecks <*****@*****.**> * * @param string $str Haystack * @param string $search Needle * @param integer $offset Offset from which character in haystack to start searching [Optional] * * @return mixed * * @uses UTF8::$server_utf8 * @uses Kohana::$charset * @uses Kohana::find_file */ public static function strrpos($str, $search, $offset = 0) { if (self::$server_utf8) { return mb_strrpos($str, $search, $offset, Kohana::$charset); } UTF8::_load(__FUNCTION__); return _strrpos($str, $search, $offset); }
/** * Finds position of last occurrence of a char in a UTF-8 string. This is * a UTF8-aware version of [strrpos](http://php.net/strrpos). * * $position = UTF8::strrpos($str, $search); * * @author Harry Fuecks <*****@*****.**> * @param string $str haystack * @param string $search needle * @param integer $offset offset from which character in haystack to start searching * @return integer position of needle * @return boolean false if the needle is not found * @uses UTF8::$server_utf8 */ public static function strrpos($str, $search, $offset = 0) { if (UTF8::$server_utf8) { return mb_strrpos($str, $search, $offset, Phalcana::$charset); } if (!isset(UTF8::$called[__FUNCTION__])) { require Phalcana::$di->get('fs')->findFile('utf8', __FUNCTION__); // Function has been called UTF8::$called[__FUNCTION__] = true; } return _strrpos($str, $search, $offset); }