Jump to content

Random function


Desdinova

Recommended Posts

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
If you want a random number between 5 and 15 (inclusive), for example, use rand (5, 15).
[/quote]

with that in mind, for your solution, you simply need to do the following:
[code]
$i = rand(1, 32);
[/code]
Link to comment
https://forums.phpfreaks.com/topic/6733-random-function/#findComment-24471
Share on other sites

[!--quoteo(post=362241:date=Apr 6 2006, 10:55 AM:name=Desdinova)--][div class=\'quotetop\']QUOTE(Desdinova @ Apr 6 2006, 10:55 AM) [snapback]362241[/snapback][/div][div class=\'quotemain\'][!--quotec--]
yeah you're right.

php.net explanes it badly. I thought rand(1,30) would create a 30char long random string.

thanks:)
[/quote]

the manual definitely can be difficult to understand at times... that's why we're here ;-)
Link to comment
https://forums.phpfreaks.com/topic/6733-random-function/#findComment-24475
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.