@@ 39-45 (lines=7) @@ | ||
36 | * @return mixed integer position or FALSE on failure |
|
37 | * @package utf8 |
|
38 | */ |
|
39 | function utf8_strpos($str, $search, $offset = FALSE){ |
|
40 | if ( $offset === FALSE ) { |
|
41 | return mb_strpos($str, $search); |
|
42 | } else { |
|
43 | return mb_strpos($str, $search, $offset); |
|
44 | } |
|
45 | } |
|
46 | ||
47 | //-------------------------------------------------------------------- |
|
48 | /** |
@@ 176-184 (lines=9) @@ | ||
173 | * @see http://www.php.net/strpos |
|
174 | * @since 1.3.0 |
|
175 | */ |
|
176 | public static function strpos($str, $search, $offset = false) |
|
177 | { |
|
178 | if ($offset === false) |
|
179 | { |
|
180 | return utf8_strpos($str, $search); |
|
181 | } |
|
182 | ||
183 | return utf8_strpos($str, $search, $offset); |
|
184 | } |
|
185 | ||
186 | /** |
|
187 | * UTF-8 aware alternative to strrpos() |