I have this javascript array
<script>
$(function() {
var foo= [ "one",
"two",
"three",
"one",
"final"];
</script>
Now, I am trying to replace the foo
with a PHP array.
<?php $array = array("sky","mac","rain","bob","sep","ion"); ?>
Now, I tried
<script>
$(function() {
var foo= [<?php array("sky","mac","rain","bob","sep","ion"); ?> ];
</script>
But, it seems not to be working
echo
ing the array's content?!json_encode
function.