-2
可能重複:
How To Find Out If You are Using HTTPS Without $_SERVER['HTTPS']
PHP Get Site URL Protocol - http vs https如何在php中獲取協議?
我怎樣才能獲得在PHP的協議?
$_SERVER['SERVER_PROTOCOL']
顯示我的HTTP/1.1,但有什麼辦法只是回聲http或https?
http://stackoverflow.com/questions/5013633/identify-whether-the-current-url-is-http-or-https-in-a-project?rq=1 – PeeHaa
的http:// stackoverflow.com/questions/7431313/php-getting-full-server-name-including-port-number-and-protocol – PeeHaa