PHP Basics In Pictures
Generate random numbers
  1. Create a new script with this code:


    $random_number = rand(1,10);

    print "<p>Your Lucky Number from 1 to 10 is $random_number.</p>\n";

    print "Click the Reload button on your browser to get a new random number.";

  2. Save the script as random.php in the PHPSCRIPTS folder.

    Here's what the relevant lines in this script do: