I know this is an old question, but you can use:
array_push($data, array($category => $question);
This will push array to the end of the current array . Or, if you are just trying to add individual values ββto the end of your array, no more arrays, you can use this:
array_push($data,$question);
Mike Jun 29 '17 at 15:54 on 2017-06-29 15:54
source share