... $to = $file; } else { $pos = strrpos($file, DIRECTORY_SEPARATOR); $to = substr($file, 0, $pos); } for ($rel = '';; $rel .= '..'.DIRECTORY_SEPARATOR) { if ($from === $to) break; if ($from === dirn...