random_int(): Random integer generator

echo random_int(8,10); // Random Output starting from 8 to 10 
Syntax
random_int ( min,max);
min ,max : Minimum and maximum value ( both inclusive ) of random integer to be generated ( both to be given )
Available in PHP 7
We can generate random value by using rand() PHP. We can specify a range and the random value between those two ranges (inclusive) will be generated.
Can be used for cryptographic random integers for shuffling a deck of cards or poker games.
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.
How to generate random string having alphabets and digits
Rounding off value
Math Functions random() Rounding off value
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Post your comments , suggestion , error , requirements etc here





    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer