multi dimensional array sort by x but randomize where x is equal

This is a discussion on "multi dimensional array sort by x but randomize where x is equal" within the PHP Forum section. This forum, and the thread "multi dimensional array sort by x but randomize where x is equal are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 21st, 2008, 09:17
SuperMember

SuperMember
Join Date: Apr 2007
Location: Sydney
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
multi dimensional array sort by x but randomize where x is equal

I have a two dimensional array with array[x][0] being a userid and array[x][1] being a rating for the user.

Most of array[x][1] will be the same, but could be anywhere from 0 to 20 in .5 increments. What I am trying to do is sort the array by array[x][1], but randomize the ones that happen to be the same, without having to split it into seperate arrays for every possible rating score. Any ideas?

http://www.freelancetechaustralia.co...ing_Technician
(on this link, you will see a user in the top section with a three star rating, they need to appear above the others)

Thanks,

Nathan.

Last edited by nate2099; Jan 21st, 2008 at 09:19.
Reply With Quote

Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-league and Multi-tiered team schedule overkil6 Website Planning 3 Jun 17th, 2008 22:04
How to convert sql statement to multi array yuexuan PHP Forum 1 Jan 20th, 2008 10:06
Sort a three dimensional array?? nate2099 PHP Forum 3 Aug 1st, 2007 16:21
Sort an array of mixed content pintofbest JavaScript Forum 0 Nov 23rd, 2006 18:55
array unable to check another array so as to be displayed Ozeona Flash & Multimedia Forum 1 Aug 5th, 2005 10:26


All times are GMT. The time now is 02:14.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43