PHP Get server-side information method, PHP get server-side
The example in this paper describes how PHP obtains server-side information. Share to everyone for your reference.
The implementation method is as follows:
Copy CodeThe code is as follows:/**
* Get System Information
*
* @return Array
*/
function GetSystemInfo ()
{
$systemInfo = Array ();
System
$systemInfo [' os '] = Php_os;
PHP version
$systemInfo [' phpversion '] = php_version;
Apache version
$systemInfo [' apacheversion '] = apache_get_version ();
Zend Version
$systemInfo [' zendversion '] = zend_version ();
GD related
if (function_exists (' Gd_info '))
{
$gdInfo = Gd_info ();
$systemInfo [' gdsupport '] = true;
$systemInfo [' gdversion '] = $gdInfo [' GD Version '];
}
Else
{
$systemInfo [' gdsupport '] = false;
$systemInfo [' gdversion '] = ';
}
Safe Mode
$systemInfo [' safemode '] = ini_get (' Safe_mode ');
Registering Global variables
$systemInfo [' registerglobals '] = ini_get (' register_globals ');
Turn on magic references
$systemInfo [' magicquotes '] = (function_exists ("GET_MAGIC_QUOTES_GPC") && GET_MAGIC_QUOTES_GPC ());
Maximum upload file size
$systemInfo [' maxuploadfile '] = ini_get (' upload_max_filesize ');
Script run consumes maximum memory
$systemInfo [' memorylimit '] = Get_cfg_var ("Memory_limit")? Get_cfg_var ("Memory_limit"): '-';
return $systemInfo;
}
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/919268.html www.bkjia.com true http://www.bkjia.com/PHPjc/919268.html techarticle PHP gets server- side information, PHP gets the server-side example of this article describes how PHP gets server-side information. Share to everyone for your reference. The concrete implementation method is as follows: ...