foreach ($courses as $course, $sections as $section, $example as $example)
任何添加超过2的方法?
我只知道2个变量的解决方案。
foreach (array_combine($courses, $sections) as $course => $section)
答案 0 :(得分:3)
如果所有数组都有相同的键,那么
foreach ($courses as $key => $course)
{
echo $sections[$key], $example[$key];
}