Re: Arrays

From: Date: Tue, 12 Jul 2005 11:50:23 +0000
Subject: Re: Arrays
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-218533@lists.php.net to get a copy of this message
Hello, You may try unset($product) in your loop if you want to delete this var. Your code $product=array(); must work too... Another way, must be to use something like this $product["id"]=$product_id; But i dont think it's your real goal?! Could you give some more information about that? Olivier Ps: documentation for unset : http://www.php.net/manual/en/function.unset.php Le Mardi 12 Juillet 2005 13:34, virtualsoftware@gmail.com a écrit : > Hi, > > How can i destroy an array? > I mean i have a loop and for each new value in the loop i want to destroy > the array. Something like that: > > while($row = mysql_fetch_array($result)) > { > > $product[] = $product_id; > > // some code here > > } > > I've tried this but doesn't work > > while($row = mysql_fetch_array($result)) > { > > $product = array(); > > $product[] = $product_id; > > // some code here > > } > > Any help would be appreciated !!

« previous php.general (#218533) next »