我正在尝试自动清理全局变量数组的输入,如下所示:
$sanitize = array('_POST', '_GET', '_REQUEST', '_COOKIE', '_SESSION');
foreach($sanitize as $type){
$property = trim(strtolower($type), '_');
$this->$property = $this->cleanse($$type);
}
但我得到:(Notice: Undefined variable: _REQUEST
对于我正在尝试的所有全局变量等等)
做我想要完成的事情真的可能吗?
谢谢。