I'm having trouble getting the correct json format from the following php array
Array
(
[0] => Array
(
[name] => name1
[data] => Array
(
[0] => Array
(
[5] => 2013-15-6,9
[6] => 2013-15-7,9
[7] => 2013-15-8,9
[8] => 2013-15-9,9
[9] => 2013-15-10,9
[10] => 2013-15-11,9
[11] => 2013-15-12,9
)
)
)
)
Encoding it to json outputs
[
{
"name": "name1",
"data": [
{
"5": "2013-15-6,9",
"6": "2013-15-7,9",
"7": "2013-15-8,9",
"8": "2013-15-9,9",
"9": "2013-15-10,9",
"10": "2013-15-11,9",
"11": "2013-15-12,9"
}
]
}
]
What I need the json output to look like is below, basically removing the curly brackets inside the data array and remove the index numbers thought I don't think that's possible.
[
{
"name": "name1",
"data": [
"2013-15-11,9",
"2013-15-12,9"
]
}
]
I've tried different combinations of array() around variables which got me close enough by adding the bracket inside the data array but I can't get rid of the curly brackets. Would really appreciate some help, have been working on this for a few hours. Thanks