Created
February 1, 2017 07:17
-
-
Save rajvanshipradeep15/107f3d6b20e6a8adfaacaca4f5b69e23 to your computer and use it in GitHub Desktop.
get current url
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
$protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; | |
$url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
echo $url; // Outputs: Full URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment