• Post category:PHP

rand() Function in PHP | Explained

rand function in PHP

It returns a random number between 0 and to the largest possible random value.

echo rand();

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

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

READ ALSO  PHP Switch Case Statement Examples

Leave a Reply