horsey_kim
horsey_kim

Reputation: 137

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

Upvotes: 1

Views: 2398

Answers (1)

Jivan
Jivan

Reputation: 23068

It is as simple as it gets. Try this:

$_POST = array();

Upvotes: 6

Related Questions