Am using chart.js to display charts on my site. The working data attribute for chart.js is in this format
"data" => ['1', '2', '3']
I have my data currently in a PHP array
Array ( [0] => 1 [1] => 2 [2] => 3 )
However this is not working for my needs. How can I convert the PHP array into the same format as above?
I have tried
json_encode($myArray)
and
implode($myArray)
without success. Any suggestions?