I'm trying to capture the entire path to a file. This is what I'm trying to get:
/dev/writeDirList/120303/lvl01dir-01/
this is my code:
$url = parse_url($_SERVER['HTTP_REFERER']);
$path = $url['path'];
echo $path;
and this is the result:
/dev/writeDirList/120303/
Why am I not getting the last directory?
Also, I'm trying to use this code:
$dirs = explode("/", "$path");
$count = count("$dirs");
$thisDir = $dirs["$count-1"];
echo $thisDir;
to just get the last directory in the path string, but $thisDir returns nothing.
What am I doing wrong?