'; // 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 '
  1. '.$id.''; echo ''; echo '
  2. '; } echo '
'; // Sort records by key ksort($record); // Format the records as a table echo ''; foreach ($record as $id => $details) { echo ''; foreach ($details as $value) { echo ''; } echo ''; } echo '
'.$id.''.$value.'
'; ?>