Re: Sort two coupled arrays {my solution]

From: Date: Thu, 08 Apr 2010 13:53:32 +0000
Subject: Re: Sort two coupled arrays {my solution]
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-303896@lists.php.net to get a copy of this message
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

« previous php.general (#303896) next »