foreach with three variables add

I guess this will solve your need:

<?php
$A=array(1,2,3);
$B=array('a','b','c');
$C=array('x','y','z');

foreach (array_map(NULL, $A, $B, $C) as $x) {
  list($a, $b, $c) = $x;
  echo "$a $b $c\n";
}

Leave a Comment