|
Posted by <newbie on 03/20/06 01:52
I was wondering if anyone can help explain this code for me
[CODE
]<table width="<?= $TABLE_WIDTH ?>" border="0" cellspacing="0" cellpadding="0">
<?php
for ($x=1; $x<=pow(2, $COLUMNS); $x++) {
// open the row
printf('<tr>');
// draw each of the columns in this row...
for ($y=1; $y<=$COLUMNS; $y++) {
// begin with a default style
$style = "line";
$value = "";
// Determine the content for the data cells (if there is any) and
// add the underline style always
if (($x % pow(2, $y)) == pow(2, $y-1)) {
[/CODE]
From what I try to understand this code
[CODE]
if (($x % pow(2, $y)) == pow(2, $y-1)) {
[/CODE]
would be a smaller number divided by a larger number and would give the remainder. I have tried a smaller number divided by a larger number in a simple script, but the remainder always seems to equal the smaller number.
[CODE]
<?php
$a=6;
$b=11;
$c=$a%$b;
echo "$a % $b = $c";
?>
[Back to original message]
|