Php Array a JS
var arrNums = json_encode(<?php echo $arrNums; ?>);
Azanda
var arrNums = json_encode(<?php echo $arrNums; ?>);
<?php
$vegetables = ['apple', 'strawberry', 'banana'];
?>
<script>
var arr = "<?php echo implode(",", $vegetables); ?>".split(",");
console.log(arr); //["apple", "strawberry", "banana"]
Vue.component('#app7', {
props: arr,
template: '<li>{{ item.text }}</li>'
})
</script>
var js_array = [<?php echo '"'.implode('","', $php_array).'"' ?>];
var js_array = [<?php echo '"'.implode('","', $disabledDaysRange ).'"' ?>];
//in js do this
var masterarray = <?php echo '["' . implode('", "', $masterarray) . '"]' ?>;
<script type="text/javascript">
var users = <?php echo json_encode($userArray); ?>;
</script>