$h = str_replace('\\', '/', $h); $dr = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']); $ex = explode($dr, $h); $h = $dr.end($ex); return $h; }