pass php arrayto javascript with json code example
Example: dump php array into javascript array
//in js do this
var masterarray = <?php echo '["' . implode('", "', $masterarray) . '"]' ?>;
//in js do this
var masterarray = <?php echo '["' . implode('", "', $masterarray) . '"]' ?>;