$d1 = array();
for($i=0;$i<10;$i++){
array_push($data, array('title' => $mytest[$i],
'heading' => 'My Heading',
'message' => $my[$i],)
);
}
Now
$data['mytest'] = $d1
Here , we are basically pushing the sub-arrays in main array and then will assign the array created to mytest
solved How to crete this type of array through using of Loop?