Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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