Created
September 29, 2017 02:46
-
-
Save amdrade/0a650c2868f161f383658d14de95f75f to your computer and use it in GitHub Desktop.
Funções PHP
This file contains hidden or 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 generateUrl() { | |
$protocol = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http'; | |
$uri = $_SERVER['REQUEST_URI']; | |
$Url = $protocol.'://'.str_replace('//', '/', $_SERVER['SERVER_NAME'].'/'.$uri); | |
return $Url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment