Possible Duplicate:
How To Find Out If You are Using HTTPS Without $_SERVER['HTTPS']
PHP Get Site URL Protocol – http vs https
How i can get the protocol in php?
$_SERVER['SERVER_PROTOCOL']
shows me the HTTP/1.1 but is there is any way to just echo http or https?
If you really just want to know if it HTTPS is enabled or not, you can just use
$_SERVER['HTTPS'].