faqts : Computers : Programming : Languages : PHP : kms : Functions

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

13 of 26 people (50%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How to get random number between 1 to 100000000 as rand(1, 100000000) display an error

Nov 16th, 2001 14:47
Dave Benjamin, Guest,


Try this function:
// Returns a random integer between $min and $max, inclusive.
function randrange($min, $max) {
    return rand() % ($max - $min + 1) + $min;
}