- var_dump: documentation ( source)
- array_reduce: documentation ( source)
<?php
$stats = array(
array(
"totalStatPower" => 4,
),
array(
"totalStatPower" => 5,
"test" => 1,
),
array(
"totalStatPower" => 10,
"test" => 2,
),
);
var_dump( array_reduce( $stats, function( $a, $b ) { return $a + $b['totalStatPower']; }, 0));