Q.1 :
i want to know that how i can set php (array) variable to javascript variable?
i have a php array like,
$array = array(1,2,3);
i know i can set variable by
var x = <?php echo $array[1]; ?>
but problem starts from here, that "1" (in above line, $array[ 1 ] wouldn't be always one it may be, 0,1,2.. anything. So how can i do it?

And Q.2 : Can i copy whole php array to javascript array?

Thanks in advance!