public static function rangeLength($value, int $minLength, int $maxLength, string $encoding = 'UTF-8'): bool
    {
        if (!static::isStringCastable($value)) {
            return false;
        }

        $strlen = (int) mb_strlen((string) $value, $encoding);

        if ($strlen < $minLength) {
            return false;
        }
        if ($strlen > $maxLength) {
            return false;
        }

        return true;
    }
public static function rangeLength($value, int $minLength, int $maxLength, string $encoding = 'UTF-8'): bool
    {
        if (!static::isStringCastable($value)) {
            return false;
        }

        $strlen = (int) mb_strlen((string) $value, $encoding);

        if ($strlen < $minLength) {
            return false;
        }
        if ($strlen > $maxLength) {
            return false;
        }

        return true;
    }
public static function rangeLength ( $ value , int $ minLength , int $ maxLength , string $ encoding = 'UTF-8' ) : bool { if ( ! static :: isStringCastable ( $ value ) ) { return false ; } $ strlen = ( int ) mb_strlen ( ( string ) $ value , $ encoding ) ; if ( $ strlen < $ minLength ) { return false ; } if ( $ strlen > $ maxLength ) { return false ; } return true ; }
Checks if value has a string length within a range

@param mixed  $value     The value
@param int    $minLength The minimum length
@param int    $maxLength The maximum length
@param string $encoding  The string encoding

@return bool
Checks if value has a string length within a range