php 判断当前url是http还是https
php 判断当前url是http还是https,代码如下:
<?php
$slhttp = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
echo $slhttp;
?>
黑蜘蛛