nulling out an array
| From: | Marc Swanson | Date: | Wed, 28 Jun 2000 15:21:13 +0000 |
| Subject: | nulling out an array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-3570@lists.php.net to get a copy of this message | ||
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-
#/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#
#Marc Swanson | \|||/ #
#MSwanson Consulting | /o o\ #
#Phone: (603)868-1721 |-ooo----O----ooo-#
#Fax: (603)868-1730 | Solutions in: #
#marcswanson@mediaone.net| 'PHP 'Perl #
# | 'SQL 'C++ #
# | 'HTML 'Sh/Csh#
#/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#