Well their's always a fix for that too, just do a check to see if the last char is a "/" then if it is then you can just truncate the string then perform the function as listed.
<?php
$path="./some/dir/";
if (strlen(strrchr('/',$path))==0)
$path = substr($path, 0, strlen($path)-1);
$pathlist = split( "/", $path);
$drop = 0; //Drop down one level.
for($i=0;$i<count($pathlist)-$drop;$i++)
{
$newpath = $newpath.$pathlist[$i]."/";
}
echo $newpath;
?>
I should have thought of this lastnight, but I guess I was too wasted.