it was always a question for me that how can i use an array value in javascript while that array is defined in my php scripts
For example consider reading some va
JSON is your choice, since some PHP 5.x version, PHP contains a function json_encode().
json_encode()
As usual, some nice guys wrote json_encode() functions for older PHP version, checkout the comments on php.net.