>>225
$a = '/a/b/c/d/';
$b = '/a/b/t/f/';
print getrPath($b,$a);

function getrPath( $base , $target) {
$base = explode("/",$base);
$target = explode("/",$target);
$ret = array();
for($i=0;$i<count($base)-1;$i++)
if($base[$i]!=$target[$i])$ret[]="..";
for($i=count($base)-1-count($ret);$i<count($target);$i++)
$ret[]=$target[$i];
return implode("/",$ret);
}
行稼ぎで気持ち悪いのは勘弁な。