'; // Add some line breaks
/* This creates an array called record
Where the course title is the array index
$arr[0] is the year
$arr[1] is the semester
$arr[2] is the course number, i.e., CSIS-110 */
$record[$arr[2]] = array($arr[3], $arr[1], $arr[0]);
}
var_dump($record); // Output the $record
// Format the records as nested lists
echo '';
foreach ($record as $id => $details) {
echo '- '.$id.'';
echo '
';
foreach ($details as $value) {
echo '- '.$value.'
';
}
echo '
';
echo ' ';
}
echo '
';
// Sort records by key
ksort($record);
// Format the records as a table
echo '';
foreach ($record as $id => $details) {
echo ''.$id.' | ';
foreach ($details as $value) {
echo ''.$value.' | ';
}
echo '
';
}
echo '
';
?>