I found a simple solution for this. The following class can help.
$Server = new Server;
$Server->MapPath("/something/other.php");
class Server{
var $root_path;
function Server(){
$physical_path = $GLOBALS['PATH_TRANSLATED'];
$this_path = $GLOBALS['PATH_INFO'];
$physical_path = str_replace("\\","\",$physical_path);
$sub_url = str_replace("/","\\",$this_path);
$this->root_path = split($sub_url,$physical_path);
$this->root_path = $this->root_path[0];
}
function MapPath($based_url){
$unmapped_url = str_replace("/","\",$based_url);
$mapped_url = $this->root_path.$unmapped_url;
$mapped_url = str_replace("\","\\",$mapped_url);
return $mapped_url;
}
}