How Can I Generate a Random Number

The general form to generate a random number is:

The $random_number variable stores the random number which you generate from the mt_rand() function.

Example

To generate and display a number from 1 to 100, the code to do this is:

$random_number= mt_rand(1, 100);
echo $random_number;