Re: Math Operator Problem?

From: Date: Mon, 09 Feb 2009 15:34:45 +0000
Subject: Re: Math Operator Problem?
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-29162@lists.php.net to get a copy of this message
On Mon, 2009-02-09 at 07:32 -0500, Alice Wei wrote: > Hi, > > I have a snippet of code as follows: > > while (!feof($fh2)) { > > $total_time=0; > $lines= fgets($fh2); > $count= strlen($lines); > if ($count == 0) { > //There are no lines > } > else { > > $total_time += $lines; > > } > } > > What I am trying to do here is to increment the total_time value and > have it display on the screen without changing the actual input file. > However, when I tried to output the result on the screen, all I am > getting is the same value as I have in the text file originally. Can > anyone on the list please give me some insight on what I am doing > wrong here? > Thanks in advance. > > > Alice > Alice, It might help if you posted a couple of lines from the $fh2 file. Are any of the lines in it empty? Thanks, James

« previous php.windows (#29162) next »