Sometimes when we using php, we want to convert php array to java script array.php array can be convert to java script easily.Here is a easy and best methods to do this.
PHP provides json_encode() function to convert PHP arrays into Java Script code.

This can be convert to java script as follows.

Note:json_encode()