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
Your code is wrong because of what is generated by PHP (especially because you use numbers as variable names in JavaScript, plus you define the same variables with each loop).
To simplify what you want to achieve, just create some variable in PHP and assign a value to it. Lets call it eg. $my_proxy_var.
Then pass it to JavaScript like that (within some tag):
var myProxyVar = ;
Just remember that:
This is important so you can avoid confusion and chose between non-associative and associative array on each level.
You can test the code on this codepad.