PHP code example of middlewares / https

1. Go to this page and download the library: Download middlewares/https 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/ */

    

middlewares / https example snippets


$dispatcher = new Dispatcher([
	(new Middlewares\Https())
		->

$responseFactory = new MyOwnResponseFactory();

//Detect the response factory automatically
$https = new Middlewares\Https();

//Use a specific factory
$htts = new Middlewares\Https($responseFactory);

$threeYears = 31536000 * 3;

$https = (new Middlewares\Https())->maxAge($threeYears);

$https = (new Middlewares\Https())->

$https = (new Middlewares\Https())->preload();

$https = (new Middlewares\Https())->checkHttpsForward();

//Disable redirections
$https = (new Middlewares\Https())->redirect(false);