xyn Posted October 19, 2007 Share Posted October 19, 2007 Hey, Can someone tell me the proper usage of unset(); as it doesnt unset my $_POST vars. my code: # Upload files # Email recipient unset($_POST); Quote Link to comment https://forums.phpfreaks.com/topic/73933-unset/ Share on other sites More sharing options...
papaface Posted October 19, 2007 Share Posted October 19, 2007 Just do unset($_POST); $_POST = array(); to unset them. Quote Link to comment https://forums.phpfreaks.com/topic/73933-unset/#findComment-373075 Share on other sites More sharing options...
igor berger Posted October 19, 2007 Share Posted October 19, 2007 Why are you trying to unset $_POST variable? $_POST is a reserved enviromental variable and will be unset when the script finishes running. Pass the value of $_POST to user defined variable then you can unset that if needed. so $myvar=$_POST; echo $myvar; echos the value of $myvar; unset($myvar); echo $myvar; result will be empty. Quote Link to comment https://forums.phpfreaks.com/topic/73933-unset/#findComment-373227 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.