>From what I understand about array_rand() and the example in the manual, it
does only pull one of each element of the array.  You could easily set up a
script to compare what it is pulling to what the array you putting it into
currently has in it if it didn't.

-Mike



> -----Original Message-----
> From: David Rice [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 10, 2002 10:49 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] random array sort
>
>
> But if array_rand() truly pulls out random keys, how do you guarantee
> that you are not randomly pulling out the same key as you iterate
> through the array?
>
> Perhaps you could set the number of keys to return, to the size of the
> array, and somehow, magically, all the keys would be included in the
> returned array of keys.
> i.e. array_rand ( array , array_size)
> I have no idea what this would produce...
> -David
>
> On Tuesday, September 10, 2002, at 10:33 AM, Mike At Spy wrote:
>
> >
> > You could use array_rand() to take stuff out of the array at random and
> > then
> > stuff it all back into another array.
> >
> > -Mike
> >
> >
> >
> >> -----Original Message-----
> >> From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]]
> >> Sent: Tuesday, September 10, 2002 10:22 AM
> >> To: [EMAIL PROTECTED]
> >> Subject: [PHP] random array sort
> >>
> >>
> >> Could someone show me a quick and simple way to randomly sort array
> >> elements?  I can't seem to pinpoint the correct parameters in the docs.
> >>
> >> Thanks!
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to