Habari\MultiByte::substr PHP Метод

substr() публичный статический Метод

Get a section of a string
public static substr ( $str, $begin, $len = null, $use_enc = null ) : mixed
$str string. The original string
$len integer. How long the returned string should be. If $len is not set, the section of the string from $begin to the end of the string is returned.
$use_enc string. The encoding to be used. If not set, the internal encoding will be used.
Результат mixed The section of the source string requested in the encoding requested or false. If $len is not set, returns substring from $begin to end of string.
    public static function substr($str, $begin, $len = null, $use_enc = null)
    {
        $enc = self::$hab_enc;
        if ($use_enc !== null) {
            $enc = $use_enc;
        }
        if (self::$use_library == self::USE_MBSTRING) {
            if (!isset($len)) {
                $len = MultiByte::strlen($str) - $begin;
            }
            $ret = mb_substr($str, $begin, $len, $enc);
        } else {
            $ret = substr($str, $begin, $len);
        }
        return $ret;
    }