copy php array to javascript

JavaScript
var js_array = [<?php echo '"'.implode('","', $php_array).'"' ?>];
Source

Also in JavaScript: