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

Recommended Answers

All 3 Replies

php json_encode code be a help

have no idea what json is.

read this


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

javascript_function(<?php echo $JSON;?>)
Be a part of the DaniWeb community

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