Return to Snippet

Revision: 2768
at March 17, 2010 14:02 by frankyfish


Updated Code
$relpath = ""; 
$tempvarrelpathdir = explode("/",dirname($SERVER['PHPSELF'])); for($i=count($tempvarrelpathdir); $i>0; $i--) if($tempvar_relpathdir[$i] != '') $relpath .= "../";

Revision: 2767
at April 13, 2007 10:40 by frankyfish


Initial Code
$path = "";
for($i=count(array_pop(explode("/",dirname($_SERVER['PHP_SELF'])))); $i>0; $i--) $path .= "../";

echo $path;

Initial URL

                                

Initial Description

                                

Initial Title
Get relative path to root

Initial Tags

                                

Initial Language
PHP