Skip to content

Instantly share code, notes, and snippets.

@jpsirois
Created June 3, 2010 15:53
Show Gist options
  • Save jpsirois/424055 to your computer and use it in GitHub Desktop.
Save jpsirois/424055 to your computer and use it in GitHub Desktop.
Always Return the current file "real document root" in PHP
<?
# This return the current file "real document root"
$root = str_replace($_SERVER['SCRIPT_NAME'],'',$_SERVER['SCRIPT_FILENAME']).'/';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment