I have a two dimensional array:
$scores = array(array(),array());
I then have a for loop which is runs data from another array:
for($i = 0; $i < sizeof($teams); $i++) {
$current_team = $teams[$i];
// some calculations and value stored in a variable named sum.
$scores($current_team, $sum); // this certainly is wrong.
}
I need to store the $current team in array one and the $sum in array two within the $score array. I tried to find information about storing multiple values in an array, but could find it. Any help will be appreciated.
So you want column 1 to be
$current_teamand column 2 to be$sum? Just create a new array on the spot, and use the$array[]syntax to add an item:If you wanted them stored inside the arrays as “rows”, however, you would use: