Re: nulling out an array

From: Date: Wed, 28 Jun 2000 15:25:09 +0000
Subject: Re: nulling out an array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-3573@lists.php.net to get a copy of this message
You could try while (condition) { $array = array (); ... } Hope this helps. Stephen. Marc Swanson wrote: > > Hello, > > I have an array that I want to destroy/null after each iteration of a while > loop. essentially I'm pulling data from a database and I am running some > calculations that I need to clear after each loop. What would really be > cool is if I could find a way to declare the array local to the inside of > the loop so it would go out of scope on block exit (each trip through the > loop), but I notice that PHP seems to only do this in the case of > subroutines. What is the best way to accomplish what I am doing? I tried > setting the array = -1 at the beginning of the loop, but that causes an > error when I try to treat it as an array later. > > Thanks > > -Marc- -- Computer Terms: Programmer - A red-eyed, mumbling mammal capable of conversing with inanimate objects. Stephen Hui, ARL:UT, Austin, TX

« previous php.general (#3573) next »