Re: [PHP] shuffle or mt_rand
- From: richardh@xxxxxxxxxxx (Richard Heyes)
- Date: Fri, 29 Jun 2007 11:13:44 +0100
Ryan A wrote:
Hey,> couple of thousand random generations patterns have been observed
Have a quick question about which is better to get real random values, shuffle or mt_rand.
I am trying to shuffle a deck of cards and reading another thread I saw that after a
> using rand()... so its better to use mt_rand().
Well they do different things - shuffle() randomises an array, whereas mt_rand() gives you a random number. If you want to randomise an array, use shuffle(). If you want a random number, use mt_rand().
--
Richard Heyes
+44 (0)844 801 1072
http://www.websupportsolutions.co.uk
Knowledge Base and HelpDesk software
.
- References:
- shuffle or mt_rand
- From: Ryan A
- shuffle or mt_rand
- Prev by Date: shuffle or mt_rand
- Next by Date: Re: [PHP] HELP - I have tried to unsubscribe from this listmutipletimes but cannot.
- Previous by thread: shuffle or mt_rand
- Next by thread: Re: [PHP] shuffle or mt_rand
- Index(es):
Relevant Pages
|