PHP get system current path and check PHP configuration parameters
function GetPath ($mainpath, $relativepath) {
Global $dir;
$mainpath _info = explode ('/', $mainpath);
$relativepath _info = explode ('/', $relativepath);
$relativepath _info_count = count ($relativepath _info);
for ($i =0; $i < $relativepath _info_count; $i + +) {
if ($relativepath _info[$i] = = '. ' | | $relativepath _info[$i] = = ') continue;
if ($relativepath _info[$i] = = ' ... ') {
$mainpath _info_count = count ($mainpath _info);
unset ($mainpath _info[$mainpath _info_count-1]);
Continue
}
$mainpath _info[count ($mainpath _info)] = $relativepath _info[$i];
}//end for
Return implode ('/', $mainpath _info);
}
Check PHP configuration Parameters
function Getphpcfg ($varname) {
Switch ($result = Get_cfg_var ($varname)) {
Case 0:
return "No";
Break
Case 1:
return "Yes";
Break
Default
return $result;
Break
}
}