This question has already been answered:
- Array from php to js 1 answer
There are 2 one-dimensional PHP arrays and 1 two-dimensional JS array
PHP arrays:
$GA_lat[] = [-35.165034,35.696121,-36.113032,-36.852924,-36.868273] $GA_lng[] = [174.162854,174.300132,174.559536,174.750234,174.711450] You need to move data from PHP arrays to a two-dimensional JS array. (Data from cell 0 to 0 cell of a two-dimensional array, etc.)
What would happen:
var locations = [ ['1', -35.165034, 174.162854, 5], ['2', -35.696121, 174.300132, 4], ['3', -36.113032, 174.559536, 3], ['4', -36.852924, 174.750234, 2], ['5', -36.868273, 174.711450, 1] ];