Era*_*rin 47
如果请求是使用HTTPS发送的,那么$ _SERVER超全局中将有一个额外的参数- $ _SERVER ['HTTPS'].您可以检查它是否已设置
if( isset($_SERVER['HTTPS'] ) ) {
Run Code Online (Sandbox Code Playgroud)
Ael*_*ios 38
如果您的请求是通过HTTPS发送的,那么您将拥有一个名为"HTTPS"的额外服务器变量
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') { //HTTPS }
Run Code Online (Sandbox Code Playgroud)
Mar*_*ens 20
$protocol = strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))=='https'?'https':'http';
$protocol = isset($_SERVER["HTTPS"]) ? 'https' : 'http';
Run Code Online (Sandbox Code Playgroud)
这些都应该有效
| 归档时间: |
|
| 查看次数: |
97398 次 |
| 最近记录: |