PHP code example of schnittstabil / harmonizer

1. Go to this page and download the library: Download schnittstabil/harmonizer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

schnittstabil / harmonizer example snippets




\Schnittstabil\Harmonizer\harmonize($_SERVER);

echo 'Hello '.$_SERVER['REMOTE_USER'];

\Schnittstabil\Harmonizer\harmonize($_SERVER);

// $_SERVER['.*'] from $_SERVER['REDIRECT_.*'], eg.
$_SERVER['HTTP_AUTHORIZATION']  // from $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
$_SERVER['GEOIP_LATITUDE']      // from $_SERVER['REDIRECT_REDIRECT_GEOIP_LATITUDE'];

// unify user variables, if needed
$_SERVER['REMOTE_USER']   // from $_SERVER['PHP_AUTH_USER']
$_SERVER['PHP_AUTH_USER'] // from $_SERVER['REMOTE_USER']

// from $_SERVER['HTTP_AUTHORIZATION']:
$_SERVER['AUTH_TYPE']       // 'Basic' or 'Digest'
$_SERVER['REMOTE_USER']     // if needed
$_SERVER['PHP_AUTH_USER']   // if needed
$_SERVER['PHP_AUTH_PW']     // if $_SERVER['AUTH_TYPE'] === 'Basic'
$_SERVER['PHP_AUTH_DIGEST'] // if $_SERVER['AUTH_TYPE'] === 'Digest'