php高级变量

WBOY
Release: 2016-06-23 13:12:42
Original
964 people have browsed it

error_reporting(0);

echo '系统类型及版本号:'.php_uname().'
';

echo '系统类型类型:'.php_uname('s').'或者'.PHP_OS.'
';

echo '系统类型版本号:'.php_uname('r').'
';

echo 'php运行模式:'.php_sapi_name().'
';

echo '当前进程用户名:'.Get_Current_User().'
';

echo 'PHP版本:'.PHP_VERSION.'
';

echo 'zend版本:'.Zend_Version().'
';

echo 'PHP安装路径:'.DEFAULT_INCLUDE_PATH.'
';

echo '当前文件绝对路径:'.__FILE__.'
';

echo 'HTTP请求中host值:'.$_SERVER['HTTP_HOST'].'
';

echo '服务器IP:'.GetHostByName($_SERVER['SERVER_NAME']).'
';

echo '接受请求的服务器IP:'.$_SERVER['SERVER_ADDR'].'
'; #有时候获取不到,GetHostByName($_SERVER['SERVER_NAME'])更靠谱;

echo '客户端IP:'.$_SERVER['REMOTE_ADDR'].'
';

echo '服务器解译引擎:'.$_SERVER['SERVER_SOFTWARE'].'
';

echo '服务器CPU数量:'.$_SERVER['PROCESSOP_IDENTIFIER'].'
';

echo '服务器系统目录:'.$_SERVER['SystemRoot'].'
';

echo '服务器域名:'.$_SERVER['SERVER_NAME'].'
'; #建议使用$_SERVER['HTTP_HOST'];

echo '用户域名:'.$_SERVER['USERDOMAIN'].'
';

echo '服务器语言:'.$_SERVER['HTTP_ACCEPT_LANGUAGE'].'
';

echo '服务器web端口:'.$_SERVER['SERVER_PORT'].'
';

?>


结果如下:



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template