问答详情
源自:3-4 MultipleIterator迭代器

受此启发想到了数组、矩阵转置的方式

//转置数组矩阵
$a = new ArrayIterator(array(1,2,3));
$b = new ArrayIterator(array('rambo','bob','smith'));
$c = new ArrayIterator(array(21,22,23));
$mit = new MutipleIterator(MutipleIterator::MIT_KEYS_ASSOC);
$mit->attachIterator($a,'id');
$mit->attachIterator($b,'name');
$mit->attachIterator($c,'age');

提问者:洪炉百炼生 2014-11-20 11:55

个回答

  • teng20131203
    2016-07-01 19:39:42

    print_r($mit);