Non ho capito esattamente cosa intendi..

Codice PHP:
<?php
$rows 
4;
$cols 15;

$matrix2 = array(
  array(
2345000000000000),
  array(
0000123000000000),
  array(
0000000123000000),
  array(
0000000000123000),
  array(
0000000000000125)
);

$accumolo '';

for(
$i 0$i <= $rows$i++) {  
    for(
$j 0$j <= $cols$j++) {  
            if(
$j==$cols) { 
                
$pezzo=$matrix2[$i][$cols]; 
                
$accumolo .= $pezzo
                if(
$i!=$rows){
                  
$accumolo .= "\n";
                }
            } else { 
                
$accumolo .= $matrix2[$i][$j].',';  
            } 
    }  
}

header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=file.csv");
header("Pragma: no-cache");
header("Expires: 0");

echo 
$accumolo;
?>