PHP: problem inserting array inside an array

dadby

New Member
I have a script that is using the google charts API and the gChart wrapper.I have an array that when dumped looks like this:\[code\]$values = implode(',', array_values($backup));var_dump($values);string(12) "8526,567,833"\[/code\]I want to use the array like this:\[code\]$piChart = new gPieChart();$piChart->addDataSet(array($values));\[/code\]I would have thought this would have looked like this:\[code\] $piChart->addDataSet(array(8526,567,833));\[/code\]Howerver when I run the code it creates a chart with only the first value. Now when I hardcode the values in instead I get each value in the chart. Does anyone know why it's acting this way?Jonesy
 
Back
Top