I've been trying to figure out how to do this -- I want to pass an array(array()) from PHP to jQuery. I've done it before with a single array but never with a nested array.
Here is my PHP code:
$sector_one = array('one' => 0, 'two' => 1, 'three' => 0, 'four' => 0);
$sector_two = array('one' => 0, 'two' => 1, 'three' => 0, 'four' => 0);
$sector_three = array('one' => 0, 'two' => 1, 'three' => 0, 'four' => 0);
$sector_four = array('one' => 0, 'two' => 1, 'three' => 0, 'four' => 0);
$array = [];
$array[0] = $sector_one;
$array[1] = $sector_two;
$array[2] = $sector_three;
$array[3] = $sector_four;
Now -- I haven't the slighest idea how to handle the data aspect of this once it's past to jquery. How would I go about accessing the information in $array[0]['one'] in jquery?