I like to get a random number from 1 to 15.
The following code doesn’t work correctly, but it will show what I want.
<?php
$randomNumber=random(1,15);
echo $randomNumber
I like to get a random number from 1 to 15.
The following code doesn’t work correctly, but it will show what I want.
<?php
$randomNumber=random(1,15);
echo $randomNumber
the PHP function to generate a random number is “rand” not “random”.
So write
<?php
$randomNumber = rand(1,15);
echo $randomNumber;
?>
(don’t forget to end lines of code with a semicolon ; - also don’t forget to close the php tag with ?> )