Just match the trailing sequence of non-slashes:
<?php
$fullpath = "/down/the/garden/path";
$parent = ereg_replace( "[/]+$", '', $fullpath );
echo "<pre>\n";
echo "full path = $fullpath\n";
echo " parent = $parent\n";
echo "</pre>\n";
?>
Hmm, I just noticed that mine leaves the trailing / on the parent, whereas your request doesn't. If you want to omit it, just add /? to the front of the regex:
"/?[/]+$"
i.e match zero or one slashes followed by one or more non-slashes at the end of the path. The ? is there in case the pathname contains no parent directory information at all.