The rand() function is used to generate a random integer number.
How to use rand() function?
Syntax of rand() function:
rand(); or rand(min,max);
min:- min is use for Specifieing the lowest number that is retuned. Default min is 0.
max:-max is use for Specifieing the highest number that is retuned.
You can see below example of rand() function.
<?php
//here call rand() finction
echo(rand() . "<br>");
//here call rand() with parameter finction
echo(rand(10,100));
?>
There are following output come of above example:
1-When print the only rand () then,
result will come
1694893849
2-When print the only rand(10,100) then,
result will come
53
Note:Both result will be change when page will get refresh
0 Comment(s)