php从函数内部访问所有全局变量[关闭]

I have many global variables in a php program. For some reason, I need a function to be able to access many or all the global variables. Is there any quick way (don't need to name them one by one such as global var1,var2,var3,car4,........; ) to declare a function to access all global variables ?

PHP's super global $GLOBALS may be what you are looking for. More information about Super globals can be found here: http://www.php.net/manual/en/language.variables.superglobals.php and for more info about $GLOBALS: http://www.php.net/manual/en/reserved.variables.globals.php