1

ishttps

is_https
SYNOPSIS

is_https()

DESCRIPTION

is_https returns true if the request is sent in HTTPS.

CODE
  1. function is_https() {
  2.     return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || $_SERVER['HTTP_X_FORWARDED_PROTO'] == 443));
  3. }
SEE ALSO

useragent

Comments

To add a comment, click here.