For example :
$number = mt_rand(1,100);
-Message d'origine-
De : William Stokes [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 30 mars 2005 12:02
À : php-general@lists.php.net
Objet : [PHP] Generate random number
Hello
How can I generate a ramdom number let's say between 1-
> -Original Message-
> From: William Stokes [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 30, 2005 12:02 PM
> How can I generate a ramdom number let's say between 1- 1 000 000 and
> store
> it in a variable?
Go to php.net, search for random and You will find...
http://php.net/manua
Hello
How can I generate a ramdom number let's say between 1- 1 000 000 and store
it in a variable?
Thanks
-Will
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Leif K-Brooks wrote:
I reccomend you RTFM!
There's a MANUAL?! Wow! :)
--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625
Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Ro
Marius wrote:
how to generate random number ?
Look no further than rand(). Well, actually do look further because
srand() is better.
Regards,
David
--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625
Wired Media Ltd
Registered O
I reccomend you RTFM!
www.php.net/rand
www.php.net/mt_rand
Marius wrote:
how to generate random number ?
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt
to decrypt it will be prosecuted to the full extent of the law.
--
PHP General Mailing List (http
how to generate random number ?
--
Marius
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Philip,
With a few tweaks, it works great, thanks!
Here's what worked:
function randomString($len)
{
global $seed;
$tmp = '';
$chars = 'abcdefghijklmnopqrstuvwxyz';
$chars .= strtoupper($chars);
$chars .= '0123456789';
if (empty($seed)) {
mt_srand ((float) microtime() * 10
Hi Bill,
Here's a quick hack, should get you on your way :
function randomString($len)
{
global $seed;
$tmp = '';
$chars = 'abcdefghijklmnopqrstuvwxyz';
$chars .= strtoupper($chars);
$chars .= '0123456789';
if (empty($seed)) {
mt_srand ((float) microtime() * 100);
$seed
Hi,
If you have random string including symbols just take them of with
regexp. Look at the manual for regular expresion functions. Hope it
helps.
Sean C. McCarthy
SCI, s.L. (www.sci-spain.com)
bill wrote:
>
> How can a random string of only letters and numbers be generated?
>
How can a random string of only letters and numbers be generated?
I'm stumped so far on how to avoid including symbols.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrat
You could use: select char(rand(128));
Will dispaly character with ascii value of 0 - 128.
Thanks,
Michael Ridinger
On Fri, 9 Mar 2001 [EMAIL PROTECTED] wrote:
> I know it is possible to generate a random number using rand() I don`t
> suppose there is anyway to generate a random letter seq
Random lower-case letter:
$randomletter = chr(rand(ord("a"), ord("z")))
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 8:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Generate Random Letters?
I know it is po
reate random strings. Just fill in $possible_letters with anything you
like
adamw
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 09, 2001 3:12 PM
Subject: [PHP] Generate Random Letters?
> I know it is possible to generate a
I know it is possible to generate a random number using rand() I don`t
suppose there is anyway to generate a random letter sequence that anyone
knows of?
Ade
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PRO
15 matches
Mail list logo