Skip to content

Instantly share code, notes, and snippets.

@VictorFursa
Created August 7, 2015 08:03
Show Gist options
  • Save VictorFursa/41770c59a2e166868af8 to your computer and use it in GitHub Desktop.
Save VictorFursa/41770c59a2e166868af8 to your computer and use it in GitHub Desktop.
$a = array(
0 => array(
0=>10,
1=>10,
2=>10
),
1 => array(
0=>43,
1=>78,
2=>78,
),
2 => array(
0=>12,
1=>532,
2=>46,
),
);
$sum = array();
$i=0;
while($i < count($a)){
$buffer = 0;
$i++;
$j=0;
while($j < count($a[$j])){
$buffer = $buffer + $a[$i][$j];
$j++;
}
$sum = $buffer;
}
var_dump($sum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment