How to get Requested protocol Http or HTTPS in PHP?

This function will return True if HTTPS when called…

is_https()
{
return strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))==’https’? true : false;
}
 is_https()
{
return strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))=='https'? true : false;
} 
Tagged with:
 

3 Responses to PHP : get Request protocol Http or HTTPS

  1. Lucas says:

    what about $_SERVER['HTTPS'] ?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Set your Twitter account name in your settings to use the TwitterBar Section.