Skip to content

Instantly share code, notes, and snippets.

@dejurin
Created September 28, 2017 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dejurin/1bf2eba27bc823255fe5930047d8d8cc to your computer and use it in GitHub Desktop.
Save dejurin/1bf2eba27bc823255fe5930047d8d8cc to your computer and use it in GitHub Desktop.
[PHP] get scheme from _SERVER
<?php
$scheme = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] === 1)) ? 'https://':'http://';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment