I am passing a PHP array to a javascript function. The only way I know to do this is to create a js array from the PHP array and pass that to the js function. But this creat
A more space-efficient way of encoding Javascript data structures is called JSON.
As of PHP 5.2.0, you can use the following function to spit out some JSON: json_encode().