PHP - Converting Data for Google Charts

I find it annoying that for a line graph, Google wants the data in this format (javascript): var data = google.visualization.arrayToDataTable([ ['Year', 'Sales', 'Expenses'], ['2004', 1000, 400], ['2005', 1170, 460], ['2006', 660, 1120], ['2007', 1030, 540] ]); In PHP form this is equal to the following (before we run JSON…

Read this article