how do I convert a php array of names and coordinates to a javascript array for google map points?

Posted by princyp on Stack Overflow See other posts from Stack Overflow or by princyp
Published on 2010-03-22T21:51:18Z Indexed on 2010/03/22 22:01 UTC
Read the original article Hit count: 205

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript