if you want to make use of your php arrays inside your javascript variables, then you will need to use json_encode
but be wary that it uses double quotes "
for arrays, which will break in your example with nested double quotes inside other nested double quotes. use single quotes to avoid that.
I have spaced things out a little better so that you can see what's happening easier.
<?php
$array_1 = array ('one','two','three');
$array_2 = array ('four','five','six');
$array_3 = array ('seven','eight','nine');
echo "
<body onload='
func1(
".json_encode($array_1).",
".json_encode($array_2).",
".json_encode($array_3)."
);
'/>
";
?>
<script>
function func1(array1, array2, array3){
arr1 = array1;
arr2 = array2;
arr3 = array3;
alert(arr1);
}
</script>
Results in this output:
<body onload='
func1(
["one","two","three"],
["four","five","six"],
["seven","eight","nine"]
);
'/>
<script>
function func1(array1, array2, array3){
arr1 = array1;
arr2 = array2;
arr3 = array3;
alert(arr1); // just print the first one, you get the idea
}
</script>