Explain this PHP Please

Associate
Joined
26 Jun 2003
Posts
1,140
Location
North West
PHP:
// 'Register globals off' protection
if (is_array($_POST)) foreach($_POST as $key=>$value) unset($$key);
if (is_array($_GET))  foreach($_GET  as $key=>$value) unset($$key);

I know its useful protect against register global stuff, so I looked for ways to do it and came accross this method.

Can someone explain each section bit by bit. Im not understanding the $key=>$value bit and also the $$key. Why two $?

Thx
 
I always use $_GET and $_POST anyway, but is the method I posted above a good fail safe just incase someone forgets?
 
Back
Top Bottom