如何获得一个PHP进程中的所有全局变量和常量
1个回答
展开全部
$GLOBALS --- 保存所有全局变量(只在当前页面中的)
get_defined_vars() --- 返回由所有已定义变量所组成的数组(包括全局变量,超全局变量等)
get_defined_constants() --- 返回由所有已定义常量所组成的数组
Superglobals — Superglobals are built-in variables that are always available in all scopes
$GLOBALS — References all variables available in global scope
$_SERVER — Server and execution environment information
$_GET — HTTP GET variables
$_POST — HTTP POST variables
$_FILES — HTTP File Upload variables
$_REQUEST — HTTP Request variables
$_SESSION — Session variables
$_ENV — Environment variables
$_COOKIE — HTTP Cookies
$php_errormsg — The previous error message
$HTTP_RAW_POST_DATA — Raw POST data
$http_response_header — HTTP response headers
$argc — The number of arguments passed to script
$argv — A
参考资料:php手册 :php.net/manual/en/reserved.variables.php
get_defined_vars() --- 返回由所有已定义变量所组成的数组(包括全局变量,超全局变量等)
get_defined_constants() --- 返回由所有已定义常量所组成的数组
Superglobals — Superglobals are built-in variables that are always available in all scopes
$GLOBALS — References all variables available in global scope
$_SERVER — Server and execution environment information
$_GET — HTTP GET variables
$_POST — HTTP POST variables
$_FILES — HTTP File Upload variables
$_REQUEST — HTTP Request variables
$_SESSION — Session variables
$_ENV — Environment variables
$_COOKIE — HTTP Cookies
$php_errormsg — The previous error message
$HTTP_RAW_POST_DATA — Raw POST data
$http_response_header — HTTP response headers
$argc — The number of arguments passed to script
$argv — A
参考资料:php手册 :php.net/manual/en/reserved.variables.php
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询