{
\"label\": \"Devices per year\",
\"data\": [
[1999, 3.0], [2000, 3.9], [200
I prefer the following syntax which gets the desired result and is clear to read:
$ar = array(
"label" => "Devices per years",
"data" => array(array(1999, 3.0), array(2000, 3.9) )
);
var_dump(json_encode($ar));
The only difference being that in the output "3.0" is rendered as "3". If you need the trailing ".0" you could surround those values with quotes.