日期:2014-05-17 浏览次数:20425 次
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)]; }