PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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} = '';
}
}
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?
flycast wrote: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?
Sometimes to condense the code, sometimes to simplify the code, or sometimes to make something that can be called from anywhere and only changed in one spot.