Is it possible to have a foreach loop in PHP with multiple \"index\" variables, akin to the following (which doesn\'t use correct syntax)?
forea
You would need to use nested loops like this:
foreach($courses as $course)
{
foreach($sections as $section)
{
}
}
Of course, this will loop over every section for every course.
If you want to look at each pair, you are better off using either objects that contain the course/section pairs and looping over those, or making sure the indexes are the same and doing:
foreach($courses as $key => $course)
{
$section = $sections[$key];
}