You can do it this way:
file1.php
$Sumatotal=0;
for($sum=0; $sum<12; $sum++){
$Sumatotal+=$sumames[$sum];
echo '<td>' . $sumames[$sum].'</td>';
}
echo '<td>' .$Sumatotal.'</td>';
file2.php
If you try, for example, to print the value of the variable $Sumatotal
in the file2.php it should look like this
<?php
require 'archivo1.php';
With this order it should be enough for the content of the $Sumavariable
to be displayed because in the file1.php you are already printing it with the instruction echo
USE OF REQUIRE
REQUIRE
Allows me in this case to require the content of another
file in a new one, that is to say when placing this instruction in the
file2.php I am indicating that it requires the content of
file1.php so that the code is available in this way