View Single Post
  #1 (permalink)  
Old 03-24-2007, 05:41 PM
J0ker J0ker is offline
WMG Resident Alien
 
Join Date: Mar 2007
Posts: 109
iTrader: (0)
J0ker is on a distinguished road
Default Simple Random Number

This is a very simple but useful technique. There are a lot of instances where you will need random numbers, and it might be hard to see where you would, but I have use them lots of times for scripts and found this command extremely useful.

PHP Code:
rand(1,100
This would create a random number between 1 and 100. In most cases you will be puting it to a variable so this would be your code:

PHP Code:
$variable rand(1,250
This sets a random number between 1 and 250 to the variable.
Reply With Quote
Sponsored Links
Register and sign in to hide this ad block