1 <?php
defined('SYSPATH') or die('No direct script access.');
7 * @copyright (c) 2007-2011 Kohana Team
8 * @copyright (c) 2005 Harry Fuecks
9 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
11 function _strrpos($str, $search, $offset = 0)
13 $offset = (int) $offset;
15 if (UTF8
::is_ascii($str) AND UTF8
::is_ascii($search))
16 return strrpos($str, $search, $offset);
20 $array = explode($search, $str, -1);
21 return isset($array[0]) ? UTF8
::strlen(implode($search, $array)) : FALSE;
24 $str = UTF8
::substr($str, $offset);
25 $pos = UTF8
::strrpos($str, $search);
26 return ($pos === FALSE) ?
FALSE : ($pos +
$offset);