for($row = 0; $row < $no_of_seq; $row++){ for($col = 0; $col < $no_of_seq; $col++){ $sum = $myArray[$row][$col] + $myArray[$row]; print($sum, "\t"); }