我通过 print_r 在下面有一个数组,但是我只需要使用其中的一部分,这样我就可以在 flot 图表中使用它。
Array ( [success] => 1 [timestamp] => 1383824357 [data] => Array ( [0] => Array ( [label] => customer1 [SUM(value)] => 12345) [1] => Array ( [label] => customer2 [SUM(value)] => 67890) [2] => Array ( [label] => customer3 [SUM(value)] => 11223 ) [3] => Array ( [label] => customer4 [SUM(value)] => 33445 ) ) )
浮动图表想要的格式是这样的(使用上述数据):
[
{ label: "customer1", data: 12345},
{ label: "customer2", data: 67890},
{ label: "customer3", data: 11223},
{ label: "customer4", data: 34455}
];
有谁知道我可以如何访问上述数据?