Re: Foreach

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 23, 2008 12:58 AM, Nathan Nobbe <quickshiftin@xxxxxxxxx> wrote:
> On Jan 18, 2008 5:24 PM, Richard Lynch <ceo@xxxxxxxxx> wrote:
>
> > If you are trying to keep the names and orders in "parallel" you need
> > to do something not unlike:
> >
> > while (list($key, $name) = each($names)){
> >  $order = $orders[$key];
> >  $query = "update whatever set order = $order where name = '$name'";
> > }
>
>
> just as a mention; spl has a DualIterator class that would be perfect for
> this
> situation.  i hesitate to mention it though, since ive not found it in any
> php
> version.  its there in the doc, but not in actual php; what a shame.
> http://www.php.net/~helly/php/ext/spl/classDualIterator.html
>
> i can only expect well see it in a subsequent version; that there is a
> reason
> its not yet made it..
>
> -nathan
>

Maybe someday SPL will become part of the PHP manual too. ;)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux