Improve mb_substr using native substr.

Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
This commit is contained in:
Hugues Peccatte 2014-09-30 21:50:07 +02:00
parent 9f79ac3c73
commit 74bc298d20

View File

@ -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);
}