I'm trying to make sense of this code.
It's a simple script to display data from a text file
<?php
if (file_exists($filename)){
$data = file($filename);
$lineno=0;
foreach ($data as $line) {
$lineno +=1;
echo nl2br($line);
if (($lineno % 2) == 0) {
echo '<hr width="50%" align="left"/> <br />';
}
}
}
?>
Can anyone tell me what the % sign in ($lineno % 2) means?
Thanks in advance
It's a simple script to display data from a text file
<?php
if (file_exists($filename)){
$data = file($filename);
$lineno=0;
foreach ($data as $line) {
$lineno +=1;
echo nl2br($line);
if (($lineno % 2) == 0) {
echo '<hr width="50%" align="left"/> <br />';
}
}
}
?>
Can anyone tell me what the % sign in ($lineno % 2) means?
Thanks in advance