This is a discussion on "Problems with random numbers..." within the PHP Forum section. This forum, and the thread "Problems with random numbers... are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Problems with random numbers...
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Problems with random numbers...
What should this code generate? My guess, 50 random numbers all between two fairly large numbers.
|
|
|
|
||||
|
Re: Problems with random numbers...
It's because the second mt_rand variable is too large by one number. You can do something like this:
|
|
|||
|
Re: Problems with random numbers...
Yeah I found a better way of doing it
$x * rand(1,50) instead of rand($x,$x*50) But its kinda strange that the max number isn't mentioned anywhere in the documentation for php |
![]() |
| Tags |
| mt_rand, php, rand |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] My page numbers are falling off of my website!! | 62vye | Web Page Design | 20 | Mar 24th, 2008 18:28 |
| Incrementing numbers | RubyRue | ASP.NET Forum | 3 | Mar 12th, 2008 03:25 |
| Specific searchable directory, think phonebook with more than numbers | AmirKhan | Website Planning | 0 | May 21st, 2007 19:38 |
| webdesigners with phone numbers contact me | jacob | Job Opportunities | 5 | Dec 9th, 2005 09:40 |
| Selecting Numbers | WillisTi | Flash & Multimedia Forum | 1 | Nov 16th, 2005 16:56 |