array php to javascript says Array code example
Example 1: php array to js
var arrNums = json_encode(<?php echo $arrNums; ?>);
Example 2: dump php array into javascript array
//in js do this
var masterarray = <?php echo '["' . implode('", "', $masterarray) . '"]' ?>;