Home > php教程 > php手册 > body text

php获取系统变量方法小结,php获取变量小结

WBOY
Release: 2016-06-13 09:03:10
Original
1009 people have browsed it

php获取系统变量方法小结,php获取变量小结

本文实例讲述了php获取系统变量的方法。分享给大家供大家参考。具体如下:

这里通过一些php内置函数获得各种系统变量。

$v = get_defined_vars();//返回由所有已定义变量所组成的数组
print_r($v);
// get all defined objects
$v = get_object_vars();//返回由对象属性组成的关联数组
print_r($v);
// classic
phpinfo();//输出关于 PHP 配置的信息
// php版本 (something like: 4.3.10)
print phpversion();//输出版本号:5.3.3

Copy after login

希望本文所述对大家的php程序设计有所帮助。

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template