Forum Moderators: coopster
Something like this:
$dirs = explode ("/", $path);
$new_path = $old_base.$dirs[count($dirs)-1];
This is just off the top of my head, so it might not actually work, it's just to give you an idea of what I mean.
If the ..'s are interspersed with directories, then the problem is slightly more complicated and would most likely require some sort of stack system.