09
Sep
stored in: PHP/MYSQL
At some point you will want a random number string but dont have the time to create new ones all the time, this is where the rand() function comes in. rand() Function creates random numbers from the numbers you set.
<?php
echo rand(0, 10);?>
The code above will create and display a random number anything from 0 to 10. If you would like a longer number you can change it, for example if i want a random number from 105 to 1043 the code will look like this.
<?php
echo rand(105, 1043);?>
Very simple and easy, if you have any questions please post a comment and i will get back to you as soon as possible.
Leave a Reply
You must be logged in to post a comment.