在PHP中创建超全局变量? [英] create superglobal variables in php?
本文介绍了在PHP中创建超全局变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以创建自己的自定义超全局变量,例如$ _POST和$ _GET?
is there a way to create my own custom superglobal variables like $_POST and $_GET?
推荐答案
静态类变量可以全局引用,例如:
Static class variables can be referenced globally, e.g.:
class myGlobals {
static $myVariable;
}
function a() {
print myGlobals::$myVariable;
}
这篇关于在PHP中创建超全局变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文