时间:2021-07-01 10:21:17 帮助过:3人阅读
array( 0=>array( 'zhangsan' => 'zhangsan (dae) abc' ) 1=>array( 'lisi' => 'lisi (dae) abc' ) 2=>array() ) 转成 array( 'zhangsan' => 'zhangsan (dae) abc', 'lisi' => 'lisi (dae) abc', )
$a = array( 0=>array( 'zhangsan' => 'zhangsan (dae) abc' ), 1=>array( 'lisi' => 'lisi (dae) abc' ), 2=>array() ); $list = array(); foreach ($a as $v) { if (!$v) { continue; } $list[key($v)] = $v[key($v)]; }