Re: Removing an Array Element
| From: | Julio Nobrega Trabalhando | Date: | Wed, 24 Oct 2001 21:15:37 +0000 |
| Subject: | Re: Removing an Array Element | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72165@lists.php.net to get a copy of this message | ||
>Basically, I just want to know if the Key is set, and if so -- remove it...
unset();...
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Jason Caldwell" <jason@thinkingman.org> wrote in message
news:20011024201518.25598.qmail@pb1.pair.com...
> How can I remove an Array Element from my Array?
>
> For example:
>
> $myArray =
>
> array('100'=>'jibberjabber','200'=>'morejibberjabber','0'=>'----');
>
> if(isset($myArray[0]))
> // here is where I want to purge Key[0] from the Array all
together....
> ;
>
> I check for the presence of Key[0], which may not be the first or last key
> in the array, so array_pop won't work... array_splice would be tricky and
> would like to avoid creating a FOREACH or FOR loop --
>
> Basically, I just want to know if the Key is set, and if so -- remove
it...
> is there a simple way to do this?
>
> Thanks
> Jason
>
>
>