RE: [PHP] Help with Array Sorting Please
| From: | Ford, Mike | Date: | Sun, 10 Oct 2004 15:09:06 +0000 |
| Subject: | RE: [PHP] Help with Array Sorting Please | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-199109@lists.php.net to get a copy of this message | ||
-----Original Message-----
From: Nick Wilson
To: php-general
* and then Ford, Mike declared....
php
> > 543 => 2
> > 432 => 2 // like here, more 2's than 1's see?
> > 566 => 2
> > 568 => 2
> > 999 => 3
> > 878 => 3
> > 444 => 3
>
> That's not terribly good, as you are using the "unknowns" (ip
addresses) as keys to the "knowns" (machine IDs). It would be better
keying off the machine IDs, although this does lead to a 2-level array;
something like:
>
> array( 1 => array(123),
> 2 => array(543, 432, 566, 568),
> 3 => array(999, 878, 444)
> )
That's exactly what i have Mike, the above was what i had generated in
an attempt to get the ips in sequential machineId order ;-)
So, now im back to square one, do you have a suggestion as to how to
acheive the goal? -
many, many thanks..
--------------------------
Uh -- I believe I included some suggested code further down the email you've
just quoted....
Cheers!
Mike