Skip to content

Instantly share code, notes, and snippets.

@rsanchez
Created September 19, 2011 14:36
Show Gist options
  • Save rsanchez/1226640 to your computer and use it in GitHub Desktop.
Save rsanchez/1226640 to your computer and use it in GitHub Desktop.
PHP current url ridiculousness
<?php
$url = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')?'https':'http'.'://'.$_SERVER['HTTP_HOST'].($_SERVER['SERVER_PORT'] != 80)?':'.$_SERVER['SERVER_PORT']:''.$_SERVER['REQUEST_URI'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment