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? 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. 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 Link to comment https://forums.phpfreaks.com/topic/26299-clearing-arrays-and-variables/#findComment-120256 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.