I know this may be a duplicate, but I cant wrap my brain around the other examples. Help would be appreciated. I have a php array that i need to assign to a javascript array
You don't need to use "var" with each line. Something like
var test = []; test[1] = 'some value'; test[2] = 'some value';
You probably want to look at using the JSON_ENCODE function from PHP