ElggCrypto::strlen PHP Method

strlen() protected method

We cannot simply use strlen() for this, because it might be overwritten by the mbstring extension. In this case, strlen() will count the number of *characters* based on the internal encoding. A sequence of bytes might be regarded as a single multibyte character. Use elgg_strlen() to count UTF-characters instead of bytes.
Author: Anthony Ferrara ([email protected])
protected strlen ( string $binary_string ) : integer
$binary_string string The input string
return integer The number of bytes From PasswordCompat\binary\_strlen
    protected function strlen($binary_string)
    {
        if (function_exists('mb_strlen')) {
            return mb_strlen($binary_string, '8bit');
        }
        return strlen($binary_string);
    }