Skip to content

Instantly share code, notes, and snippets.

@bwonur
Created November 11, 2019 08:00
Show Gist options
  • Select an option

  • Save bwonur/9940242101f36261dfcaaabb9560036b to your computer and use it in GitHub Desktop.

Select an option

Save bwonur/9940242101f36261dfcaaabb9560036b to your computer and use it in GitHub Desktop.
http or https
<?php if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off'
|| $_SERVER['SERVER_PORT'] == 443) {
// HTTPS
} else {
// HTTP
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment