how do I convert a php array of names and coordinates to a javascript array for google map points?
- by princyp
I have a php array that has a bunch of data that I need but specifically I need just the name and longitude and latitude from each item in the array so that I can display points on a google map. The google map array needs to look like this in the end
var points = [
['test name', 37.331689, -122.030731, 4]
['test name 2', 37.331689, -122.030731, 4]
];
What is the best way to put my php data into a js array?