php一行代码判断请求头http、https
$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://'; echo $http_type . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
滴水成冰,世间不存在毫无意义的付出,时间终会给你答案。