PHP: HTTP or HTTPS? [duplicate]

If the request was sent with HTTPS you will have a extra parameter in the $_SERVER superglobal – $_SERVER[‘HTTPS’]. You can check if it is set or not

if( isset($_SERVER['HTTPS'] ) ) {

Leave a Comment