SQL PHP HTML ASP JavaScript articles and free scripts to download
PHP Math

Random number generator

We can generate random value by using PHP. We can specify a range and the random value between those two ranges (inclusive) will be generated.

Note that here we are generating a random number only. To get any random characters we can use arrays. The details on how to generate random characters is available here.

Here is the code to generate random numbers.

echo "<br>Random Value = ".rand(5,10);    
// Will display random value between 5 and 10 ( both inclusive )

Read here how to generate random string having alphabets and digits

Number of User Comments : 1


how to generate the random number in php
Post Comment This is for short comments only. Use the forum for more discussions.
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2015 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer