$class){ array_push($prevCoreCourses, $class); } } $prevElectCourses = Array(); //creates an array of previous taken courses for comparison foreach($prevElect as $idToCourse) { foreach($idToCourse as $courseID=>$class){ array_push($prevElectCourses, $class); } } $prevCognCourses = Array(); //creates an array of previous taken courses for comparison foreach($prevCogn as $idToCourse) { foreach($idToCourse as $courseID=>$class){ array_push($prevCognCourses, $class); } } global $prevAllCourses; $prevAllCourses = array_merge(array_merge($prevCoreCourses,$prevElectCourses), $prevCognCourses); } } ?>