tags:

views:

23

answers:

1

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

A: 
Saxtor