ParagonIE_Sodium_Core_Util::strlen

Advertisement

Summery Summery

Safe string length

Syntax Syntax

ParagonIE_Sodium_Core_Util::strlen( string $str )

Parameters Parameters

$str

(string) (Required)

Return Return

(int)

Source Source

File: wp-includes/sodium_compat/src/Core/Util.php

    public static function strlen($str)
    {
        /* Type checks: */
        if (!is_string($str)) {
            throw new TypeError('String expected');
        }

        return (int) (
        self::isMbStringOverride()
            ? mb_strlen($str, '8bit')
            : strlen($str)
        );
    }

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.