PHP send get array to JavaScript code example
Example 1: set array in javascript from php
//set array in javascript from php array
var jsarry = <?php echo '["' . implode('", "', $phparry) . '"]' ?>;
Example 2: php array to js
var arrNums = json_encode(<?php echo $arrNums; ?>);