I have this code:
$rows = array();
$table = array();
foreach($kol as $r) {
$temp = array();
// the following line will be used to slice the Pie chart
$m = array('label' => (string) $r['naziv'], 'type' => 'string');
$rows[] = ($m);
}
$table['cols'] = $rows;
and I get this json:
{"cols":[{"label":"Pera Peric","type":"string"},{"label":"IMT 510-td","type":"string"},{"label":"Laza Lazic","type":"string"}
How I can put data on $m array to position 0 to get json like this:
{"cols":[{"label":"Datum,"type":"Date"},{"label":"Pera Peric","type":"string"},{"label":"IMT 510-td","type":"string"},{"label":"Laza Lazic","type":"string"}
so here I just want to add this data: {"label":"Datum,"type":"Date"} to array ...