Code: Select all
$dateRange = array('2010-01-01', '2010-01-02', '2010-01-03', ...);
$data = array('2010-01-01' => 5, '2010-01-03' => 7);
foreach ($dateRange as $date) {
$values[$date] = $data[$date];
}
< /code>
$values
array (
'2010-01-01' => 5
'2010-01-02' => null
'2010-01-03' => 7
...
)
< /code>
Seems fairly efficient, but I wonder if there's a simple PHP function that'll handle this.