Strange way to handle functions - why this way?
Posted: Tue Oct 02, 2007 8:26 pm
I have some code some one else wrote. They have a functions.php file that has lots of functions defined like this:
Then in a differennt file called UnsetAll_func.php the have the function:
I am trying to understand why the function that calls a function. What is the purpose? Why not just call the function directly instead of indirectly?
Code: Select all
function UnsetAll() { global $FUNCTION_PATH; return include($FUNCTION_PATH.'UnsetAll_func.php'); }Code: Select all
global $_POST;
reset($_POST);
//use key as variable variable
while (list($key,$value) = each($_POST)){
//exclude sess_id
if ($key != 'sess_id'){
//must set to global to access
global ${$key};
${$key} = '';
}
}