时间:2021-07-01 10:21:17 帮助过:23人阅读
$a = array ( 0 => array ( 0 => array ( 'ID' => '2IT14035A', ), 1 => array ( 'ID' => '5IE14032S', ), 2 => array ( 'ID' => '1IE15003B', ), 3 => array ( 'ID' => '1IE15010C', ), ), 1 => array ( 0 => array ( 'ID' => '1IE14210D', ), 1 => array ( 'ID' => '1IE15001A', ), 2 => array ( 'ID' => '1IT15001G', ), 3 => array ( 'ID' => '1IT14033S', ), ),);foreach($a as $k=>$v) $r[$k] = array_map('current', $v);print_r($r);
Array( [0] => Array ( [0] => 2IT14035A [1] => 5IE14032S [2] => 1IE15003B [3] => 1IE15010C ) [1] => Array ( [0] => 1IE14210D [1] => 1IE15001A [2] => 1IT15001G [3] => 1IT14033S ))
还是要这样
$a = array ( 0 => array ( 0 => array ( 'ID' => '2IT14035A', ), 1 => array ( 'ID' => '5IE14032S', ), 2 => array ( 'ID' => '1IE15003B', ), 3 => array ( 'ID' => '1IE15010C', ), ), 1 => array ( 0 => array ( 'ID' => '1IE14210D', ), 1 => array ( 'ID' => '1IE15001A', ), 2 => array ( 'ID' => '1IT15001G', ), 3 => array ( 'ID' => '1IT14033S', ), ),);foreach($a as $k=>$v) $r[$k] = join(',', array_map('current', $v));print_r($r);
Array( [0] => 2IT14035A,5IE14032S,1IE15003B,1IE15010C [1] => 1IE14210D,1IE15001A,1IT15001G,1IT14033S)
第二种。太感谢您了。
如果我想显示到网页上
第一组:2IT14035A,5IE14032S,1IE15003B,1IE15010C
第二组:1IE14210D,1IE15001A,1IT15001G,1IT14033S
直接print_r($r[0]) 对吗