php判断服务器l是否为https

/**
    动态获取当前请求的url
/*
<?php

$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTPS'] !='off' || $_SERVER['SERVER_PORT'] == 443) ?'https':'http';
$url = $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
echo $url;


你可能感兴趣的:(PHP,https,服务器)