Home  >  Q&A  >  body text

Please give the teacher some guidance!

<?php

function BG($B,$G = Green){

$i = 1;

while ( $i < 10) {

echo '<table width="800" border = "1" >';

if ($i%1 == 0) {

echo "<tr bgcolor = '$G' />";

if ($i%2 == 0) {

echo "<tr bgcolor = '$B' />";

}

}

echo '<td>' .$i. '</td>';

$i++;

echo '</table>';

}

return;

}

BG(Blue);

?>

梅川内库梅川内库2621 days ago1433

reply all(1)I'll reply

  • 按键盘手指磨破皮

    按键盘手指磨破皮2017-09-08 09:47:30

    You have to say it clearly if you want to give me advice. I think your code is probably reporting an error, because your Green and Blue do not have quotation marks. If you add quotation marks, the error will not be reported

    reply
    1
  • Cancelreply