Improve mb_substr using native substr.
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
This commit is contained in:
parent
9f79ac3c73
commit
74bc298d20
@ -35,6 +35,12 @@ if (!@function_exists('mb_strlen')) {
|
||||
*/
|
||||
function mb_substr($string, $start, $length = 2147483647)
|
||||
{
|
||||
if (null === $string || strlen($string) <= $start) {
|
||||
return '';
|
||||
}
|
||||
if (null === $length) {
|
||||
$length = 2147483647;
|
||||
}
|
||||
return substr($string, $start, $length);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user