1.11M Members

php associate array to javascript

 
0
 

i have a php associate array and i want to convert it to a javascript array. how best do i do this

 
0
 

php json_encode code be a help

 
0
 

have no idea what json is.

 
0
 

read this
http://www.w3schools.com/json/default.asp

then

use json_encode in your php like
$JSON = json_encode($your_array) then pass this in your javascript
example

javascript_function(<?php echo $JSON;?>)
Question Answered as of 1 Year Ago by code739
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: