laravel string to javascript array code example
Example 1: copy php array to javascript
var js_array = [<?php echo '"'.implode('","', $php_array).'"' ?>];
Example 2: laravel array to js
var app = @json($array);
var js_array = [<?php echo '"'.implode('","', $php_array).'"' ?>];
var app = @json($array);