• Post category:PHP

rand() Function in PHP | Explained

rand function in PHP

rand():int
It returns a random number between 0 and to the largest possible random value.
Ex:

echo rand();

rand(minvalue:int, maxvalue:int):int
Returns a random number between minvalue and maxvalue.
Ex:
echo rand(1, 10);

In this example, the rand() function returns 1 to 10.

Leave a Reply