I was in a position where I had 6 identical arrays and I needed to pick the right one depending on another variable and then assign values to it. In the case shown here $comp_cat was 'a' so I needed to pick my 'a' array ( I also of course had 'b' to 'f' arrays)
Note that the values for the position of the variable in the array go after the closing brace.
${'comp_cat_'.$comp_cat.'_arr'}[1][0] = "FRED BLOGGS";
${'comp_cat_'.$comp_cat.'_arr'}[1][1] = $file_tidy;
echo 'First array value is '.$comp_cat_a_arr[1][0].' and the second value is .$comp_cat_a_arr[1][1];