I have this code here...
$remaining = 0; foreach($clientArrayInvoice as $key=>$row){ $remaining = $remaining + $row[\'total\']; }
again --> see php's abs() function if you want to add things and ignore the sign.