I am unable to figure out how to assign PHP array to jQuery array?. 
I want to do something like the following:
var jQueryArray = <?php $phpArray; ?>;
Can anyone tell me how I can do this?
I am unable to figure out how to assign PHP array to jQuery array?. 
I want to do something like the following:
var jQueryArray = <?php $phpArray; ?>;
Can anyone tell me how I can do this?
Use json encode.
json_encode — Returns the JSON representation of a value
Example:
var arrayFromPHP = <?php echo json_encode($arr); ?>;
    echo was missing. Sorry, I have updated the codeIt's not going to be a JQuery array, it's a javascript array (just to clarify since it's sounds like you're probably a noob). Set your JS array to this:
<?php echo json_encode($phpArray);?>
See php json_encode docs: http://php.net/manual/en/function.json-encode.php
You can use Json or use foreach in HTML file
<?php foreach($phpArray as $key => $val): ?>
      jQueryArray[<?php echo $key; ?>] = <?php echo $val; ?>
<?php endforeach; ?>