| @@ 92-98 (lines=7) @@ | ||
| 89 | * @return mixed string or FALSE if failure |
|
| 90 | * @package utf8 |
|
| 91 | */ |
|
| 92 | function utf8_substr($str, $offset, $length = FALSE){ |
|
| 93 | if ( $length === FALSE ) { |
|
| 94 | return mb_substr($str, $offset); |
|
| 95 | } else { |
|
| 96 | return mb_substr($str, $offset, $length); |
|
| 97 | } |
|
| 98 | } |
|
| 99 | ||
| 100 | //-------------------------------------------------------------------- |
|
| 101 | /** |
|
| @@ 219-227 (lines=9) @@ | ||
| 216 | * @see http://www.php.net/substr |
|
| 217 | * @since 1.3.0 |
|
| 218 | */ |
|
| 219 | public static function substr($str, $offset, $length = false) |
|
| 220 | { |
|
| 221 | if ($length === false) |
|
| 222 | { |
|
| 223 | return utf8_substr($str, $offset); |
|
| 224 | } |
|
| 225 | ||
| 226 | return utf8_substr($str, $offset, $length); |
|
| 227 | } |
|
| 228 | ||
| 229 | /** |
|
| 230 | * UTF-8 aware alternative to strtolower() |
|