On Friday 10 May 2002 14:27, Miguel Cruz wrote:
> There's really not much to it. The intval of '-' is 0, so it doesn't cause
> any problems.
>
> $numbers = file('path/logfile.txt');
> $total = 0;
> foreach ($numbers as $num) $total += intval($num);
Or use array_sum():
$numbers = file('pa
There's really not much to it. The intval of '-' is 0, so it doesn't cause
any problems.
$numbers = file('path/logfile.txt');
$total = 0;
foreach ($numbers as $num) $total += intval($num);
miguel
On Fri, 10 May 2002, Liam MacKenzie wrote:
> another real basic question, how would I add up
2 matches
Mail list logo