php array in javascript code example Example: copy php array to javascript var js_array = [<?php echo '"'.implode('","', $php_array).'"' ?>];