$arr = array( array('id' => 123, 'name' => '张三', 'amount'=>'1'), array('id' => 123, 'name' => '李四', 'amount' => '1'), array('id' => 124, 'name' => '王五', 'amount' => '1'), array('id' => 125, 'name' => '赵六', 'amount' => '1'), array('id' => 126, 'name' => '赵六', 'amount' => '2'), array('id' => 126, 'name' => '赵六', 'amount' => '2') ); $new = array(); foreach($arr as $row){ if(isset($new[$row['id']])){ $new[$row['id']]['amount'] += $row['amount']; }else{ $new[$row['id']] = $row; } } print_r($new);