Re: Sort two coupled arrays {my solution]

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

 



At 6:46 PM -0400 4/7/10, Ryan Sun wrote:
rsort(array_combine(array2, array1));

you should expect array(
  'Personal Email' => 75,
  'USPS mail' => 40,
  'Personal Phone' => 31,
  'Web site' => 31,
  'Text Message' => 31
)

logically, the items are your key but not the count of votes


Logically, combine_array() will work to combine the two arrays as you said, as shown here:

http://www.webbytedd.com/bbbb/array-combine/

I've tried rsort(), but is does not solve the problem presented, which was to sort the items depending upon their values.

Thus far, my solution is the only one that works.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

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