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 cannot use an integer as a variable name, like in this line: print "var 25[".$i."]=" .$result1['25'].";\n";. 25 cannot be a variable.
If you want to map an array to a javascript object, you might want to take a look at json_encode
EXAMPLE
Your code could be written like this:
looks much cleaner to me.