fread how to Count total from Counter text
- by snikolov
hey i have a counter text here and i need to know how to calculate the total this is my information 
$filename = "data.txt";
$handle   = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
$expode   = explode("\n",$contents);
/**
output 
1024
1024
1024
1024
1024
1024
1024
1024
1024
1024
1024
1024
1024
*/
I i need to calculate the total by exploding "\n" so i will output 12288 need to understand how to do this i have done this 
foreach ($expode as $v) 
{ 
    $total  = $total + $v;
echo $total;
} 
i did not get good results with this