How to convert PHP array to JavaScript array
The code below can convert your php array to JavaScript array
$phpArray = array(); <-- this is your php array
<script>
var jsArray = <?php echo json_encode($phpArray); ?>; <--this is your new js array
</script>