How To Determine HTTP Protocol Using PHP

Author: , May 11th, 2012

$protocol = (!empty($_SERVER[‘HTTPS’]) && $_SERVER[‘HTTPS’] !== ‘off’) ? “https:” : “http:”;