Re: Php warning message
| From: | Greg Bowser | Date: | Wed, 20 Feb 2008 21:43:15 +0000 |
| Subject: | Re: Php warning message | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269746@lists.php.net to get a copy of this message | ||
>
> *$boardFile = "MessageBoard.txt";
> $boardFileHandle = fopen($boardFile,"r");
> for ($counter = 1; !feof($boardFileHandle); $counter += 1) {
> $colorLine = fgets(boardFilehandle);
> if ($counter % 2 == 0) {
> echo "<font color='00ff00'>$colorline</font>";
> } else {
> echo $colorline;
> }
> }
> fclose($boardFileHandle);*
Looks like you're missing a $ on line 4:
$colorLine = fgets(boardFilehandle);
Should be
$colorLine = fgets($boardFilehandle);
[snip]
I may be showing my ignorance here... But on your if ($counter % 2
==0) line what does the "%" do? Was that possibly a typo?
[/snip]
It's the modulus operator; he's trying to make every other line a different
color. :)
-- Greg