Psr7Middlewares\Middleware\BasicAuthentication::parseAuthorizationHeader PHP Method

parseAuthorizationHeader() private static method

Parses the authorization header for a basic authentication.
private static parseAuthorizationHeader ( string $header ) : false | array
$header string
return false | array
    private static function parseAuthorizationHeader($header)
    {
        if (strpos($header, 'Basic') !== 0) {
            return false;
        }
        $header = explode(':', base64_decode(substr($header, 6)), 2);
        return ['username' => $header[0], 'password' => isset($header[1]) ? $header[1] : null];
    }