CoderZone.org

Category: >> PHP Code >> Rounded random numbers Bookmark and Share

<< lastnext >>

Snippet Name: Rounded random numbers

Description: Make nice, clean random numbers. This example will return a whole number between 1 and 1000.

Also see:
» Generate Random Keys
» Exponentially Weighted Random Numb...
» Weighted Random Number Function
» Random Image from Directory
» Random banner picker
» Generate random string
» Random Pronounceable Passwords
» Pick Randomly from Array
» Weighted Random Choice

Comment: (none)

Author: CoderZone
Language: PHP
Highlight Mode: PHP
Last Modified: March 16th, 2009

$foo = round(rand(1, 1000));
 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© coderzone.org | users online: 3