Services_JSON::strlen8()publicWP 1.0

Deprecated from version 5.3.0. It is no longer supported and can be removed in future releases. Use PHP native JSON extension instead.

Calculates length of string in bytes

Method of the class: Services_JSON{}

No Hooks.


Int. length


$Services_JSON = new Services_JSON();
$Services_JSON->strlen8( $str );
$str (required)


Deprecated since 5.3.0 Use the PHP native JSON extension instead.

Services_JSON::strlen8() code WP 6.1.1

function strlen8( $str ) 
    _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' );

    if ( $this->_mb_strlen ) {
        return mb_strlen( $str, "8bit" );
    return strlen( $str );