subscription what if you need foreach in []
?
$data[] = [
"name" => $key["add_hour"].":00",
"data" => [[
"x" => (int) $key["add_date"],
"y" => (int) $key["times"]
]
// x y]
];
like this
$data [] = [
] "name" => $key["add_hour"].":00",
"data" => [[
"x" => (int) $key["add_date"],
"y" => (int) $key["times"]
],
[
"x" => (int) $key["add_date"],
"y" => (int) $key["times"]
],
[
"x" => (int) $key["add_date"],
"y" => (int) $key["times"]
]]
];