Skip to content

Instantly share code, notes, and snippets.

@DannyNunez
Created January 9, 2013 15:23
Show Gist options
  • Save DannyNunez/4493954 to your computer and use it in GitHub Desktop.
Save DannyNunez/4493954 to your computer and use it in GitHub Desktop.
Set variable for server root to include path globally to your sites.
<?php
$new_root = explode('/',$_SERVER['DOCUMENT_ROOT']);
array_pop($new_root);
include_once(implode('/',$new_root).'path to file');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment