Re: emptying hte array??
| From: | Scott Fletcher | Date: | Wed, 15 Jan 2003 13:53:06 +0000 |
| Subject: | Re: emptying hte array?? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131701@lists.php.net to get a copy of this message | ||
It wouldn't be a good idea to undefined the array with 'unset()' if it is to
be re-use.....
"Jason K Larson" <jlarson@candlefire.org> wrote in message
news:3E24C050.30208@candlefire.org...
> That's not going to 'empty' the array it's going to undefine it.
> Just overwrite the array with a new empty array like:
>
> $a = array();
>
> That keeps the variable an array variable type and is of course empty.
>
> HTH,
> Jason k Larson
>
> Justin French wrote:
>
> > on 15/01/03 7:52 AM, Scott Fletcher (scott@abcoa.com) wrote:
> >
> >
> > >How to do the proper way of emptying hte array??
> > >
> > >Example...
> > >
> > >$a[0] = "test1";
> > >$a[1] = "test2";
> > >$a[2] = "test3";
> > >$a[3] = "test4";
> > >
> > >$a = ""; <-- Is this hte proper way to do it????
> >
> >
> > unset($a);
> >
> > http://php.net/unset
> >
> > Justin
>