Translate this page

PHP Array to JavaScript Array

How to convert PHP array to JavaScript array

The code below can convert your php array to JavaScript array

$phpArray = array(); <-- this is your php array
var jsArray = <?php echo json_encode($phpArray); ?>;  <--this is your new js array

Leave a Reply

Your email address will not be published. Required fields are marked *