I am trying to create an array out of three arrays in the following manner:
$file_data = array();
foreach($file_ids as $key => $id){
foreach($file_names as $name_key => $name){
foreach($file_amounts as $file_key => $cost){
$file_data[] = array("id" => $id, "filename" => $name, "amount" => $cost);
break;
}
break;
}
}
It's creating the first row only. How can I get it to properly assign the values to the $file_data array?
Thanks.
UPDATE: As an example, I have the following for the three arrays
$file_ids[0] = 2;
$file_ids[1] = 4;
$file_name[0] = name1;
$file_name[1] = name2;
$file_amount[0] = 10;
$file_amount[1] = 9;
These arrays will always be of the same size.
What I would like to do is iterate over these arrays and end up with a final array of the form:
$final_array = (id, name, amount)
for all rows in other arrays.