Re: Php warning message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 20, 2008 at 4:38 PM, Jason Pruim <japruim@xxxxxxxxxx> 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); } ?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux