is it possible to turn this data (retrieved from sql database) into this data
[{
"DATE": "2016-02-08",
"STORE": "1",
"SALES": "34"
}, {
"DATE": "2016-02-08",
"STORE": "2",
"SALES": "11"
}, {
"DATE": "2016-02-08",
"STORE": "3",
"SALES": "19"
}]
into this
[{
"DATE": "2016-02-08",
"STORE1": "34",
"STORE2": "11",
"STORE3":"19"
}]
either through the sql select or array manipulation?
EDIT
to extend this question further if the array contained multiple days how would i create a multidimensional array like below
Array (
[0] => array (
"DATE": "2016-02-08",
"STORE1": "34",
"STORE2": "11",
"STORE3":"19"
)
[1] => array (
"DATE": "2016-02-08",
"STORE1": "34",
"STORE2": "11",
"STORE3":"19"
)
)