Skip to content

Instantly share code, notes, and snippets.

@jordanandree
Created December 27, 2010 23:24
Show Gist options
  • Save jordanandree/756695 to your computer and use it in GitHub Desktop.
Save jordanandree/756695 to your computer and use it in GitHub Desktop.
<?php
function siteroot()
{
global $siteroot;
$siteroot = explode('/', $_SERVER['PHP_SELF']);
$siteroot = 'http://' . $_SERVER['SERVER_NAME'] . '/' . $siteroot[1];
return $siteroot;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment