Re: Multi-Sort -- how to do this?

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

 



On Wed, Jun 17, 2009 at 17:11, tedd<tedd@xxxxxxxxxxxx> wrote:
> Hi gang:
>
[snip!]
>
> Is there a slick way to do that?



    Hacked together in the two minutes before I go to bed, so don't
complain about its inelegance.  ;-P

<?php
$a = array('apple', 'banana', 'grape', 'orange');
$b = array(100, 2111, 198, 150);
$c = array('red', 'yellow', 'purple', 'orange');
$d = array(100, 300, 11, 50);

for($i=0;$i<count($d);$i++) {
  $e[$d[$i]]['a'] = $a[$i];
  $e[$d[$i]]['b'] = $b[$i];
  $e[$d[$i]]['c'] = $c[$i];
}

ksort($e);

print_r($e);
?>


-- 
</Daniel P. Brown>
daniel.brown@xxxxxxxxxxxx || danbrown@xxxxxxx
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000

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