PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $data = [ ['id' => '3202','total' => '5'], ['id' => '3190','total' => '2'], ['id' => '3199','total' => '5'] ]; $total_column = array_column($data, 'total'); $sum = array_sum($total_column); printf('The sum of total column: %s', $sum);
Show:  
Copy Clear