If you have PHP 5.5+ you can do this without looping or using a callback (since function calls are relatively expensive) … just use:
$sum = array_sum(array_column($account_invoices, 'vatAmount'));
If you have PHP 5.5+ you can do this without looping or using a callback (since function calls are relatively expensive) … just use:
$sum = array_sum(array_column($account_invoices, 'vatAmount'));