Search code examples
phppostunset

Using unset for $_POST -


My code has multiple $_POST variables. I like to clean things up and unset them after everything has been executed.

I don't want to have to list each $_POST out individually. Is there a good way of unset all $_post values at once. I don't want to unset my $_SESSIONS or other variables. Just the Post ones.

Any helpful hints is very much appreciated.

I tried using unset($_POST); - but it does not unset the values. Thanks


Solution

  • It is as simple as it gets. Try this:

    $_POST = array();