Created
October 24, 2013 23:40
-
-
Save nathan-isaac/7147050 to your computer and use it in GitHub Desktop.
Get full Site URL including "HTTP" or "HTTPS".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function siteURL() | |
{ | |
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; | |
$domainName = $_SERVER['HTTP_HOST'].'/'; | |
return $protocol.$domainName; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment