I know this question was asked before, but mine is slightly different. how can I include the index while creating a multidimensional array using a foreach.
I have these array
$array1=["math","sci"]
$arry2=["paper 1", "paper 2", "paper 3"]
array3=[50, 70,80]
how can I create an array in this format using foreach loop.
array
'math' =>
array
'paper 1' => 50
'paper 2' => 70
'paper 3' => 80
'Sci' =>
array
'paper 1' => 50
'paper 2' => 70
'paper 3' => 80