Creating random number using php

This Tutorial Has Been Viewed 382 Times.

Here is the simple code to create random numbers in php,

<?php
srand((double)time()*1000000);
echo rand(0,200);

?>

OR
<?php
srand((double)microtime()*1000000);
echo rand(0,100); ?>

VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

Incoming search terms:





You will also be interested in ,

Tags:

Leave a Reply

Spam protection by WP Captcha-Free

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks
More in PHP (112 of 123 articles)


Here we will discuss how to create directories, manipulate them etc using simple php script.A complete reference for php directory ...