jumpenjuhosaphat Posted November 6, 2006 Share Posted November 6, 2006 I am making a user sign in script, and I want to validate the script. When validating, if the script finds any errors, I want the error to be echo'd, and the page to refresh, but, I need to clear any variables and arrays, like the $_POST array, so that the script doesn't continue to try to validate the form. Is there a simple way of doing this? Quote Link to comment https://forums.phpfreaks.com/topic/26299-clearing-arrays-and-variables/ Share on other sites More sharing options...
Orio Posted November 6, 2006 Share Posted November 6, 2006 If you want to empty an array, you can write-$array=array(); or in your case $_POST=array();Orio. Quote Link to comment https://forums.phpfreaks.com/topic/26299-clearing-arrays-and-variables/#findComment-120255 Share on other sites More sharing options...
HuggieBear Posted November 6, 2006 Share Posted November 6, 2006 You can also use [url=http://uk.php.net/manual/en/function.unset.php]unset()[/url]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/26299-clearing-arrays-and-variables/#findComment-120256 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.