protected static function isBase64Valid(string $encode): bool
    {
        $decode = base64_decode($encode, true);

        if (false === $decode) {
            return false;
        }

        return base64_encode($decode) === $encode;
    }
protected static function isBase64Valid(string $encode): bool
    {
        $decode = base64_decode($encode, true);

        if (false === $decode) {
            return false;
        }

        return base64_encode($decode) === $encode;
    }
protected static function isBase64Valid ( string $ encode ) : bool { $ decode = base64_decode ( $ encode , true ) ; if ( false === $ decode ) { return false ; } return base64_encode ( $ decode ) === $ encode ; }
Check base64 encoded string is valid or not.

@param string $encode

@return bool
Check base64 encoded string is valid or not .