That won't work, as that will only unset the *value* not the *element*.

I think I have to do the following as there isn't a prebuilt PHP array
function that does what I need -- the following should work fine:

$myArray =
array('100'=>'jibberjabber','200'=>'morejibberjabber','0'=>'----');

if(isset($myArray[0]))
{
     foreach($myArray as $key=>$value)
     {
          if($key == 0)
          continue;

          $newArray[$key] = $value;
     }
$myArray = $newArray;
}

Thanks though -- :-)

Jason


"Julio Nobrega Trabalhando" <[EMAIL PROTECTED]> wrote in
message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >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" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > 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
> >
> >
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to