As seen in this other answer, there are several ways to iterate two same-sized arrays simultaneously; however, all of the methods have a rather significant pitfall. Here ar
As of PHP 5.5 you can do this:
foreach (array_map(null, $array1, $array2) as list($item1, $item2)) { var_dump($item1); var_dump($item2); }
http://us3.php.net/manual/en/control-structures.foreach.php#control-structures.foreach.list