Safely extracting variables in PHP
Published: August 7, 2003
User Rating: 7.8 (18 votes)
How to use
The format for passing the arguments to SafeExtract is as follows
SafeExtract( array( 'TYPE1' => array('var1'[, 'var2', 'var3', ... ]), 'TYPE2' => array('var1'[, 'var2', 'var3', ... ]), 'TYPE3' => array('var1'[, 'var2', 'var3', ... ]), 'TYPE4' => array('var1'[, 'var2', 'var3', ... ]) ) );
where TYPE can be any one of the 'any', 'get', 'post', 'cookie'
'any' would extract the variables, passed from any method, i.e. GET, POST or COOKIE
'get' would extract only those variables passed from GET
'post' would extract only those variables passed from POST
'cookie' would extract only those variables passed from COOKIE


