$nowdir=$_SERVER["SCRIPT_FILENAME"];
//echo $nowdir."<br>";
/**
* The below regulartion will only support windows system,
* because in windows system if you use $_SERVER["SCRIPT_FILENAME"] to get
* file's path,it will like "c:/xxx/xxx",but in linux the path will be
* "/root/xxx/xxx"
*/
preg_match('/(.*///)/si', $nowdir, $match );
//echo $match[1] ;
$rootdir=$match[1];
//echo $nowdir."<br>";
/**
* The below regulartion will only support windows system,
* because in windows system if you use $_SERVER["SCRIPT_FILENAME"] to get
* file's path,it will like "c:/xxx/xxx",but in linux the path will be
* "/root/xxx/xxx"
*/
preg_match('/(.*///)/si', $nowdir, $match );
//echo $match[1] ;
$rootdir=$match[1];