<?php
$t1 = array (
"basicInfo" => array (
"The Sineps",
"December 25, 2010",
"lemonpole"
),
"overallRecord" => array (
0,
0,
0,
0
),
"overallSeasons" => array (
"season1.cs" => array (0, 0, 0),
"season2.cs" => array (0, 0, 0)
),
"matches" => array (
"season1.cs" => array (
"week1" => array ("12", "3", "1"),
"week2" => array ("8", "8" ,"0"),
"week3" => array ("8", "8" ,"0")
),
"season2.cs" => array (
"week1" => array ("9", "2", "5"),
"week2" => array ("12", "2" ,"2")
)
)
);
foreach ($t1['matches'] as $season => $weeks) {
foreach ($weeks as [$w, $l, $d]) {
$t1['overallSeasons'][$season][0] += $w;
$t1['overallSeasons'][$season][1] += $l;
$t1['overallSeasons'][$season][2] += $d;
}
}
var_export($t1);
- Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
- array (
'basicInfo' =>
array (
0 => 'The Sineps',
1 => 'December 25, 2010',
2 => 'lemonpole',
),
'overallRecord' =>
array (
0 => 0,
1 => 0,
2 => 0,
3 => 0,
),
'overallSeasons' =>
array (
'season1.cs' =>
array (
0 => 28,
1 => 19,
2 => 1,
),
'season2.cs' =>
array (
0 => 21,
1 => 4,
2 => 7,
),
),
'matches' =>
array (
'season1.cs' =>
array (
'week1' =>
array (
0 => '12',
1 => '3',
2 => '1',
),
'week2' =>
array (
0 => '8',
1 => '8',
2 => '0',
),
'week3' =>
array (
0 => '8',
1 => '8',
2 => '0',
),
),
'season2.cs' =>
array (
'week1' =>
array (
0 => '9',
1 => '2',
2 => '5',
),
'week2' =>
array (
0 => '12',
1 => '2',
2 => '2',
),
),
),
)
preferences:
68.71 ms | 409 KiB | 5 Q