Array
(
[0] => Array
(
[column] => teplo
[da] => 5
)
[1] => Array
(
[column] => teplo
[net] => 2
)
[2] => Array
(
[column] => sherst
[est] => 3
)
[3] => Array
(
[column] => sherst
[net] => 4
)
[4] => Array
(
[column] => kril
[net] => 5
)
[5] => Array
(
[column] => kril
[est] => 2
)
[6] => Array
(
[column] => moloko
[est] => 4
)
[7] => Array
(
[column] => moloko
[net] => 3
)
[8] => Array
(
[column] => yaico
[net] => 3
)
[9] => Array
(
[column] => yaico
[est] => 4
)
)
Array
(
[0] => Array
(
[column] => teplo
[da] => 5
[net] => 2
)
[1] => Array
(
[column] => sherst
[est] => 3
[net] => 4
)
[2] => Array
(
[column] => kril
[net] => 5
[est] => 2
)
[3] => Array
(
[column] => moloko
[est] => 4
[net] => 3
)
[4] => Array
(
[column] => yaico
[net] => 3
[est] => 4
)
)
// Объявление входного массива
$t0 = Array
(
'0' => Array
(
'column' => teplo,
'da' => 5
),
'1' => Array
(
'column' => teplo,
'net' => 2
),
'2' => Array
(
'column' => sherst,
'est' => 3
),
'3' => Array
(
'column' => sherst,
'net' => 4
),
'4' => Array
(
'column' => kril,
'net' => 5
),
'5' => Array
(
'column' => kril,
'est' => 2
),
'6' => Array
(
'column' => moloko,
'est' => 4
),
'7' => Array
(
'column' => moloko,
'net' => 3
),
'8' => Array
(
'column' => yaico,
'net' => 3
),
'9' => Array
(
'column' => yaico,
'est' => 4
)
);
// Немного магии
$t1 = array_values(array_map('unserialize', array_unique(array_map('serialize', array_map(function($a){return array_merge($a[0], $a[1]);}, array_map(function($a_m) use ($t0){return array_values(array_filter($t0, function($a_f) use ($a_m){return $a_f['column']==$a_m['column'];}));}, $t0))))));
// Вывод результата, полностью соответствующего требуемому
print_r($t1);
$t1 = array_values(
array_map(
'unserialize',
array_unique(
array_map(
'serialize',
array_map(
function($a){
return array_merge($a[0], $a[1]);
},
array_map(
function($a_m) use ($t0){
return array_values(
array_filter(
$t0,
function($a_f) use ($a_m){
return $a_f['column']==$a_m['column'];
}
)
);
},
$t0
)
)
)
)
)
);