i have a results from a python file ( i don't know python it is from someone else) and it looks like that:
["title1" =>1442,"title2" =>16664,"title3" =>555,"title4" =>65,"title5" =>234]
i need to make this into that to show in morris chart:
$donutvalues = array(
array( 'label' => "air" , 'value' => 125) ,
array( 'label' => "light" , 'value' => 40),
array( 'label' => "rest" , 'value' => 10 )
echo json_encode($donutvalues );
when i return this to the ajax call it works. so i need to prepare what comes back from the python file to this sort of array.
so i need the titles to be the values of the label, and the numbers to be the values of the value.