public static function slice($string, $start, $length = null)
    {
        if (function_exists('mb_substr')) {
            return mb_substr($string, $start, $length, '8bit');
        }
        return substr($string, $start, $length);
    }
public static function slice($string, $start, $length = null)
    {
        if (function_exists('mb_substr')) {
            return mb_substr($string, $start, $length, '8bit');
        }
        return substr($string, $start, $length);
    }
public static function slice ( $ string , $ start , $ length = null ) { if ( function_exists ( 'mb_substr' ) ) { return mb_substr ( $ string , $ start , $ length , '8bit' ) ; } return substr ( $ string , $ start , $ length ) ; }
Returns the portion of byte string specified by the start and length
parameters.

@param string $string
String.
@param int $start
Offset to start at.
@param int $length
Optional length of slice.
@return string Slice.
Returns the portion of byte string specified by the start and length parameters .