Print.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Assignment045</title>
</head>
<body>
<p>
The driving students where just given a challege. The person who reached more than
120mph in one mile with their cars would receive a brand new BMW.<br />
Here are the results:
</p>
Student1: 149mph<br />
Student2: 113mph<br />
Student3: 126mph<br />
Student4: 119mph<br />
Student5: 121mph<br />
Student6: 97mph<br />
Student7: 105mph<br />
Student8: 89mph<br /><br />
<?php
$speed[0]=149;
$speed[1]=113;
$speed[2]=126;
$speed[3]=119;
$speed[4]=121;
$speed[5]=97;
$speed[6]=105;
$speed[7]=89;
echo "<p>";
echo "There are ".count($speed)." speed marks in the array.";
echo "</p>";
for ($counter=0; $counter < count($speed) ; $counter=$counter+1)
{
if ($speed[$counter] >120)
{
print("A new BMW for student ".($counter+1)."!<br>");
}
}
?>
</body>
</html>