The plain approach will be to use array_map()
or loops like:
$data = array(
0 => array(
'XXX' => array(
'Field1' => '0_Val_1',
'Field2' => '0_Val_2',
'Time3' => '2014-04-08 10:00:00',
)
),
1 => array(
'XXX' => array(
'Field1' => '1_Val_1',
'Field2' => '1_Val_2',
'Time3' => '2014-04-08 11:00:00',
)
)
);
$remove = ['Field2']; //which keys to remove
$new = ['Time4'=>['Time3'=>'+1 second']]; //new Time4 depends of old Time3 with +1second
$result = array_map(function($x) use ($remove, $new)
{
return array_map(function($y) use ($remove, $new)
{
$y = array_diff_key($y, array_flip($remove));
foreach($new as $key=>$exp)
{
$y[$key] = date('Y-m-d H:i:s', strtotime($y[key($exp)].current($exp)));
}
return $y;
}, $x);
}, $data);