Re: Re: Muti-Dimensional Array Help Please

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

 



* and then M. Sokolewicz declared....
> However, if it does matter, then I suggest a different way. This would 

Yes, it does matter, a *lot* ;-)
I have to hit each machine in order, choosing an IP from that machine
and using it do 'do_stuff()'

> order them by their 2nd index, not the first (meaning by 
> $machines[1][1], $machines[2][1], etc);
> <?php
> $max = 0;
> foreach($machines as $machineId => $ips) {
>    $max = ($max >= count($ips) ? $max : count($ips));
> }
> 
> for($i=0;$i<$max;$i++) {
>    foreach($machines as $machineId => $ips) {
>       if(isset($ips[$i])) {
>          do_stuff($ips[$i]);
>       } else {
>          continue;
>       }
>    }
> }
> ?>

Would that work with what i said above? im afraid i've never got the
hang of the ? operator and dont really understand your code, sorry...

thanks very much..

-- 
Nick W

-- 
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