Skip to content

Instantly share code, notes, and snippets.

@s-hiroshi
Created October 28, 2015 21:54
Show Gist options
  • Save s-hiroshi/bcab59bd0a1221c7d38a to your computer and use it in GitHub Desktop.
Save s-hiroshi/bcab59bd0a1221c7d38a to your computer and use it in GitHub Desktop.
/**
* Get current page uri
*
* @return string current page uri.
*/
private function getUrl() {
if ( isset( $_SERVER['HTTPS'] ) AND $_SERVER['HTTPS'] == 'on' ) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER["HTTP_HOST"];
$uri .= $_SERVER["PHP_SELF"];
return $uri;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment