Re: note 14479 added to ref.array.php
| From: | Jeroen van Wolffelaar | Date: | Wed, 01 Aug 2001 20:51:47 +0000 |
| Subject: | Re: note 14479 added to ref.array.php | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-16188@lists.php.net to get a copy of this message | ||
> If you want to clear the contents of an array but have iterated it some
way (and the pointer of the array is not pointing to the first element),
remember to RESET the array before you clear it.
>
> reset($myarray);
> $myarray = array();
Why should you?
Jeroen
----- Original Message -----
From: <sauli@tampereDONTWRITETHIS.net>
Newsgroups: php.notes
To: <php-notes@lists.php.net>
Sent: Wednesday, August 01, 2001 8:29 PM
Subject: note 14479 added to ref.array.php
> If you want to clear the contents of an array but have iterated it some
way (and the pointer of the array is not pointing to the first element),
remember to RESET the array before you clear it.
>
> reset($myarray);
> $myarray = array();
>
> http://www.php.net/manual/en/ref.array.php
>