Re: Php warning message
| From: | Daniel Brown | Date: | Wed, 20 Feb 2008 22:16:02 +0000 |
| Subject: | Re: Php warning message | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269753@lists.php.net to get a copy of this message | ||
On Wed, Feb 20, 2008 at 4:38 PM, Jason Pruim <japruim@raoset.com> wrote:
> I may be showing my ignorance here... But on your if ($counter % 2
> ==0) line what does the "%" do? Was that possibly a typo?
"If the line is divisible by 2."
>
> Also, it might be good to point out what line 52 is :)
He did.... it's the line on which you'll find foef(). ;-P
Yuval,
Change your code to:
<?
$filename = "./MessageBoard.txt";
$handle = fopen($filename,"r");
for($counter=1;!feof($handle);$counter++) {
$colorline = fgets($handle);
if ($counter % 2 == 0) {
echo "<font color=\"#00ff00\"
/>".$colorline."</font>\n";
} else {
echo $colorline;
}
}
fclose($handle);
?>
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>