I'm not too good with JavaScript or PHP yet, but i think this code will work. NOTE I don't know MySQL functions yet, so you'll have to fill those in.
~Code on site~
<form action="parse.php" method="post">
<script language="JavaScript">
arr = new Array(...);
document.write('<input type="hidden" name="arrLength" value="' + arr.length() + '">');
while (loopnum < arr.length()) {
loopnum += 1;
document.write('<input type="hidden" name="arr' + loopnum + '" value="' + arr[loopnum] + '">');
}
</script>
</form>
~parse.php~
<?PHP
/ MySQL connect code /
while ($loopnum < $arrLength) {
$loopnum += 1;
$output = $arr . $loopnum; //this code probably won't work, i don't know what will take precedence
/ Write $output to database /
}
/ MySQL database close code /
?>