Home | Scripts | Tutorials | Books | Hosting | Forums | Links|

Navigation:

Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links






 
 

SPONSORS



 
 

Random number examples

this shows how to generate random numbers .

here is the script

<?php
//produce random numbers
srand((double)microtime()*1000000);
//number between 1 and 100
$random_number1 = rand(1,100);
echo ("$random_number1<br>");
//between 1 and 50 this time
$random_number2 = rand(1,50);
echo ("$random_number2<br>");
//finally between 55 and 95
$random_number3 = rand(55,95);
echo ("$random_number3");
?>

and here is the output

75
47
94