DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Random Number

01.21.2006
| 2344 views |
  • submit to reddit
        Replace 1 and 10 with the range you want to pick a number between. This example will pick a random number between 1 and 10.

$randomnumber= rand(1,10);