Skip to content

Instantly share code, notes, and snippets.

@Usse
Created November 14, 2012 10:43
Show Gist options
  • Save Usse/4071474 to your computer and use it in GitHub Desktop.
Save Usse/4071474 to your computer and use it in GitHub Desktop.
Check if HTTPS or HTTP
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) {
// HTTPS code
} else {
// HTTP code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment