I am new to this so please do not judge.
I have transformed a .csv file into an
array([0]=>array([0]=>string(), [1]=>string())[1]=>array([0]=>string(), [1]=>string())
etc. So I can access it numerically i.e.$the_big_array[1][1]
Now I want the program to write a couple of lines of code for each array within an array.
-
Basically what I am doing is creating a table like this that will be encoded in json.
$request['AddPrice'][0][variable1] = $the_big_array[1][2]
$request['AddPrice'][0][variable2] = $the_big_array[1][3]
and I want different values loaded for and from each line of .csv file/$the_big_array
$request['AddPrice'][1][variable1] = $the_big_array[1][2]
$request['AddPrice'][1][variable2] = $the_big_array[1][3]
I am stuck at foreach function as I cannot grasp how to make it execute certain action for each array within an array.