Last active
January 14, 2016 16:31
-
-
Save ddmills/5e1ea8008b6ff72d7ffc to your computer and use it in GitHub Desktop.
Relative Path to Root
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* get a relative path to the sites root */ | |
$root = preg_replace(':/[^/]+:', '../', dirname($_SERVER['SCRIPT_NAME'])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment