I have a one (very) big PHP array (with 649 indexes).
I want to set a javascript variable to specific index of it and that index will depend on another variable. Is there any way? I know i can copy whole PHP array into JavaScript Array using json_encode($phpArray)
, but i don't want whole array to be loaded on client side
(for speed and some sort of security).
$phpArray[0] = "i am first element";
$phpArray[1] = "i am second element";
/* ......... */
$phpArray[100] = "i am 100th element";
and now, let us say, i want to get second element of $phpArray
? how can i do it?