Re: [nyphp-talk] Unsetting array elements

2006-10-20 Thread Aaron Fischer
Thanks Ken. Unfortunately I figured that out AFTER I sent the original question. =) -Aaron Ken Robinson wrote: > At 03:17 PM 10/20/2006, Aaron Fischer wrote: > >>Hi, >> >>I'd like to cycle through an array and destroy some elements (and leave >>some intact). What's the "best" way to do that

Re: [nyphp-talk] Unsetting array elements

2006-10-20 Thread Aaron Fischer
I fixed that line and it's working now: else { unset($test[$k]); } However I would be interested to hear if anyone thinks there is a better or more efficient approach to how I am doing it. Cheers, -Aaron Aaron Fischer wrote: > Hi, > > I'd like to cycle through an array and destroy some elem

Re: [nyphp-talk] Unsetting array elements

2006-10-20 Thread Ken Robinson
At 03:17 PM 10/20/2006, Aaron Fischer wrote: >Hi, > >I'd like to cycle through an array and destroy some elements (and leave >some intact). What's the "best" way to do that? > >Here's what I put together so far (which shows my array ignorance) =) > > >$test=array("auth" => "yes" , "name" => "joe"

[nyphp-talk] Unsetting array elements

2006-10-20 Thread Aaron Fischer
Hi, I'd like to cycle through an array and destroy some elements (and leave some intact). What's the "best" way to do that? Here's what I put together so far (which shows my array ignorance) =) "yes" , "name" => "joe" , "sort" => "ascending") while (list ($k, $v) = each ($test)) {