您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息

php 获取系统当前路径与检查php配置参数

2024/4/16 11:42:50发布6次查看
php 获取系统当前路径与检查php配置参数
function getpath($mainpath, $relativepath) {
  global $dir;
  $mainpath_info           = explode('/', $mainpath);
  $relativepath_info       = explode('/', $relativepath);
  $relativepath_info_count = count($relativepath_info);
  for ($i=0; $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);
 }
 // 检查php配置参数
 function getphpcfg($varname) {
  switch($result = get_cfg_var($varname)) {
   case 0:
   return no;
   break;
   case 1:
   return yes;
   break;
   default:
   return $result;
   break;
  }
 }
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录