I have a multi-dimensional PHP array where the key for each inner array is an ID of button I will be clicking and instantiating a jQuery function.
I basically want to dynamically create a javascript VAR array from that PHP array based on the Id that is clicked. Here is the array:
$ContentGroupIds = array(
43 => array( 511, 531, 567 ),
54 => array( 483, 499, 509 )
);
So you can see I have ContentGroupId's: 43 and 54
which each point to an array of ContentId's
.
When I click on the button for ContentGroupId = 43
, I need to dynamically set the jquery var to look like this:
var contentids = ['511','531','567'];
Then I can use that var
in the rest of my jquery function.