1. Tina (Student id: 101)
2. Justin (Student id: 102)
3. Linda (Student id: 103)
4. Lisa (Student id: 104)
5. Tom (Student id: 105)
Code:
<html>
<head>
<title>PHP TEST YAHHH</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<div class="topbar">
<?php
include 'navbar.php';
?>
</div>
<?php
//ex 7.3
// a
echo '<br>';
$students = array(101 => 'Tina', 102 => 'Justin', 103 => 'Linda', 104 => 'Lisa', 105 => 'Tom');
$length = count($students) + 101;
for ($i = 101; $i < $length; $i++)
{
echo $i - 100;
echo ". ";
echo $students[$i];
echo ' (Student id: ';
echo $i;
echo ")";
echo '<br>';
}
/* outputs in this format:
*/
?>
<div class="codebox">
<h3>Code:</h3>
<?php
highlight_file("ex022.php");
?>
</div>
</body>
</html>