次のように、グローバル変数の配列で入力を自動的にサニタイズしようとしています。
$sanitize = array('_POST', '_GET', '_REQUEST', '_COOKIE', '_SESSION');
foreach($sanitize as $type){
$property = trim(strtolower($type), '_');
$this->$property = $this->cleanse($$type);
}
しかし、私は次のようになります:(Notice: Undefined variable: _REQUEST
私が試しているすべてのグローバル変数についても同様です)
私が達成しようとしていることは実際に可能ですか?
ありがとう。