|
Posted by olivier on 07/12/05 14:50
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 !!
Navigation:
[Reply to this message]
|