//set array in javascript from php array var jsarry = <?php echo '["' . implode('", "', $phparry) . '"]' ?>;