I am using http://www.jqplot.com/tests/pie-donut-charts.php which needs to have data given to it in the following format:
//JavaScript
var data = [
['Heavy Industry', 12],['Retail', 9], ['Light Industry', 14],
['Out of home', 16],['Commuting', 7], ['Orientation', 9]
];
The data is generated serverside with PHP. I am manually creating the string as follows:
//PHP
$string.='["'.$row['name'].'",'.$row['count'].'],';
I would rather just create an array, and use json_encode() or something similar to create the data. Any suggestions how I would do so?
json_encode($array);?