From the query, I get name year and month name and its rate. From the query some year have only 4 months. So how can I add other missing months with default rate 0.0 to following array?
$data = array();
foreach($result as $key => $val){
$data[$val['name']][$val['year']][date('F', strtotime("2000-".$val['month']."-01"))]= $val['rate'];
}
$resultinputand sampleoutput. E.g. bpaste.net/raw/0de604fbd6ea