php 获取系统当前路径与检查php配置参数
函数 getPath($mainpath, $relativepath) {
全局 $dir;
$mainpath_info = 爆炸('/', $mainpath);
$relativepath_info =explode('/', $relativepath);
$relativepath_info_count = count($relativepath_info);
for ($i=0; $i
if ($relativepath_info[$i] == '.' || $relativepath_info[$i] == '') 继续;
if ($relativepath_info[$i] == '..') {
$mainpath_info_count = count($mainpath_info);
取消设置($mainpath_info[$mainpath_info_count-1]);
继续;
}
$mainpath_info[count($mainpath_info)] = $relativepath_info[$i];
} //结束
return implode('/', $mainpath_info);
//检查PHP配置参数
函数 getphpcfg($varname) {
switch($result = get_cfg_var($varname)) {
案例 0:
返回“否”;
休息;
情况1:
返回“是”;
休息;
默认值:
返回$结果;
休息;
}