<?php
$outer = array (
47 =>
array (
'2019-02-24' =>
array (
'AVA_Id' => 1,
'AVA_Status' => 'Open'
),
'2019-02-25' =>
array (
'AVA_Id' => 3,
'AVA_Status' => 'Open'
),
'2019-02-28' =>
array (
'AVA_Id' => 4,
'AVA_Status' => 'Close'
),
),
48 => array (
'2019-02-26' =>
array (
'AVA_Id' => 2,
'AVA_Status' => 'Open'
)
)
);
$daterange = array (
0 => '2019-02-24',
1 => '2019-02-25',
2 => '2019-02-26',
3 => '2019-02-27',
4 => '2019-02-28',
5 => '2019-03-01',
6 => '2019-03-02'
);
$template = array_fill_keys($daterange,['AVA_Id' => 0,'AVA_Status' => 'No']);
foreach ($outer as $ind => $dates) {
$output[$ind] = $template;
foreach ($dates as $d => $v) {
$output[$ind][$d] = $v;
}
}
print_r($output);
preferences:
49.67 ms | 402 KiB | 5 Q