| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
vague™
Join Date: Mar 2004
Location: Glasgow
Posts: 5,595
|
php random array sorting
Trying to sort an array pseudo-randomly by feeding a pseudo-random seed to a function. Basically, need to "randomize" a result set but need to be able to reconstruct that result set in the same order sometime in the future. Already know how to generate random seeds, any ideas as to the sorting with a seed? --- just to clarify: array ( 1, 2, 3, 4, 5 ) Bob visits the site and gets the result set: 3,4,1,2,5 next time bob visits he gets 3,4,1,2,5 again. Last edited by i_am_cam : 07-01-2005 at 10:39. |
|
|
|
|
|
#2 (permalink) |
|
hmmm...
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
|
You'll be needing the srand function like this PHP Code:
See it here: http://www.gsgd.co.uk/xhtml/rand_array.php |
|
![]() |