After running a MySQL query, I utilized json_encode to convert the query result and this is what I received:
[
{"id":"1","map_id":"1","description":"This is Athens","lat":"37.77994127700315","lng":"23.665237426757812","title":"Athens"},
{"id":"2","map_id":"1","description":"This is Rome","lat":"41.9100711","lng":"12.5359979","title":"Rome"}
]
I am attempting to transform this into a JavaScript array but only getting the values. For instance:
myArray = [
[1, 1, 'This is Athens', 37.77994127700315,23.665237426757812, 'Athens'],
[2, 1, 'This is Rome', 41.9100711, 12.5359979, 'Rome']
]
I have tried multiple solutions that were suggested here, however, none of them provided me with an array exactly like myArray
.