Many thanks Thomas and Maciek. I'll try removing mt_srand to start with,
and if that doesn't work out I'll put in the uniqueness check.
Cheers,
Gordon.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
keown [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 27, 2004 11:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Random number generation and phpBB search IDs
Hi,
I'm currently experiencing a problem with a phpBB board that appears to
be due to the way random number generation works in PHP. I ha
Gordon McKeown wrote:
Apologies, my mail client was supposed to line-wrap that for me
-
Hi,
I'm currently experiencing a problem with a phpBB board that appears
to be due to the way random number generation works in PHP. I have
posted on serveral phpBB boards and have received no answers, s
Apologies, my mail client was supposed to line-wrap that for me
-
Hi,
I'm currently experiencing a problem with a phpBB board that appears
to be due to the way random number generation works in PHP. I have
posted on serveral phpBB boards and have received no answers, so I
think I need to un
Hi,
I'm currently experiencing a problem with a phpBB board that appears to
be due to the way random number generation works in PHP. I have posted
on serveral phpBB boards and have received no answers, so I think I need
to understand how PHP is dealing with this in order to resolve it.
phpBB ge
I have a script that loads 13 or more file names into an array. Then at
random I select one of the names out of the array. This files are background
songs used on my webpage. Streaming a different song each time the page is
refreshed or loaded. My issue is I do not want the same song to ever be
pla
3B733@BOOTROS...
> The manual also says:
> mt_rand -- Generate a better random value
>
> I've been using mt_rand() over rand() every time - is there any reason not
> to?
>
> Cheers
> Jon
>
>
> -Original Message-
> From: elias [mailto:[EMAIL PROTECTED
The manual also says:
mt_rand -- Generate a better random value
I've been using mt_rand() over rand() every time - is there any reason not
to?
Cheers
Jon
-Original Message-
From: elias [mailto:[EMAIL PROTECTED]]
Sent: 03 May 2001 00:05
To: [EMAIL PROTECTED]
Subject: Re: [PHP] R
Regards,
Avetis
[EMAIL PROTECTED] wrote:
> Hi there,
> A potentially dumb question here.
>
> Is there an easy way to display a random number between 1 and 20?
>
> I have looked on line, but either I am looking inall teh wrong places, or there
> isn't this script on-line.
>
> Can anyone point m
Wotcha Tris :-)
Try this:
mt_srand((double)microtime()*100);
$my_random_number = mt_rand(1, 20);
HTH
Jon
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 02 May 2001 12:07
To: [EMAIL PROTECTED]
Subject: [PHP] Random number generation...
Hi there,
A
why not use the rand() ?
manual says:
rand -- Generate a random value
Description
int rand ([int min [, int max]])
If called without the optional min, max arguments rand() returns a
pseudo-random value between 0 and RAND_MAX. If you want a random number
between 5 and 15 (inclusive), for examp
Hi there,
A potentially dumb question here.
Is there an easy way to display a random number between 1 and 20?
I have looked on line, but either I am looking inall teh wrong places, or there
isn't this script on-line.
Can anyone point me in the right direction?
Cheers,
Tris...
***
12 matches
Mail list logo