<?php$arr = ['1', '2', '3', '4'];foreach ($arr as &$i) {}echo implode($arr, ', ')."\n"; //1,2,3,4foreach ($arr as $i) {}echo implode($arr, ', ')."\n"; //1,2,3,3?>
$arr = ['1', '2', '3', '4']; foreach ($arr as &$i) {}echo implode($arr, ', ')."\n"; //1,2,3,4 foreach ($arr as $i) { echo '*' . join(',', $arr), PHP_EOL;}echo implode($arr, ', ')."\n"; //1,2,3,3
1, 2, 3, 4*1,2,3,1*1,2,3,2*1,2,3,3*1,2,3,31, 2, 3, 3
明白了,谢谢