PHP : get Request protocol Http or HTTPS

This item was filled under [ PHP ]

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: [ , , ]
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Comment