<?php






$handle = fopen('data_in.csv','r');
$handle_output = fopen('data_out.csv','w');
$row = 0;
$arr = array();

while ($line = fgetcsv($handle)) 
{
    $arr[] = $line;
}


$arr[1][0] = 0; 
$arr[2][1] = 0; 


foreach ($arr as $line) 
{
    if ($row==0) 
    {
        array_push($line,);
    } 
    else 
    {
        array_push($line,array_sum($line));
    }
    fputcsv($handle_output, $line);  
    $row++;
}
?>