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

Recommended Answers

php json_encode code be a help

Jump to Post

All 3 Replies

php json_encode code be a help

have no idea what json is.

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;?>)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.