欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP獲取服務(wù)器端信息的方法

 更新時(shí)間:2014年11月28日 09:07:36   投稿:shichen2014  
這篇文章主要介紹了PHP獲取服務(wù)器端信息的方法,通過一個(gè)自定義函數(shù)實(shí)現(xiàn)對服務(wù)器端系統(tǒng)版本、PHP版本、Apache版本等信息的獲取,是非常實(shí)用的技巧,需要的朋友可以參考下

本文實(shí)例講述了PHP獲取服務(wù)器端信息的方法。分享給大家供大家參考。

具體實(shí)現(xiàn)方法如下:

復(fù)制代碼 代碼如下:
/**
 * 獲取系統(tǒng)信息
 *
 * @return array
 */
function getSystemInfo()
{
 $systemInfo = array();
 
 // 系統(tǒng)
 $systemInfo['os'] = PHP_OS;
 
 // PHP版本
 $systemInfo['phpversion'] = PHP_VERSION;
 
 // Apache版本
 $systemInfo['apacheversion'] = apache_get_version();
 
 // ZEND版本
 $systemInfo['zendversion'] = zend_version();
 
 // GD相關(guān)
 if (function_exists('gd_info'))
 {
  $gdInfo = gd_info();
  $systemInfo['gdsupport'] = true;
  $systemInfo['gdversion'] = $gdInfo['GD Version'];
 }
 else
 {
  $systemInfo['gdsupport'] = false;
  $systemInfo['gdversion'] = '';
 }
 
 // 安全模式
 $systemInfo['safemode'] = ini_get('safe_mode');
 
 // 注冊全局變量
 $systemInfo['registerglobals'] = ini_get('register_globals');
 
 // 開啟魔術(shù)引用
 $systemInfo['magicquotes'] = (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc());
 
 // 最大上傳文件大小
 $systemInfo['maxuploadfile'] = ini_get('upload_max_filesize');
 // 腳本運(yùn)行占用最大內(nèi)存
 $systemInfo['memorylimit'] = get_cfg_var("memory_limit") ? get_cfg_var("memory_limit") : '-';
 
 return $systemInfo;
}

希望本文所述對大家的PHP程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評論