Why doesn't the color show up?
Dante
Dante 2019-02-14 17:19:42
0
2
1695

为什么不显示颜色

<?php


    function test($color1,$color2="red"){

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

        for($i=1;$i<11;$i ){

            if($i%2==0){

                echo '<tr bgcolor:$color2>';

            }else{

                echo '<tr bgcolor:$color1>';

            }

            for($j=1;$j<11;$j ){

                echo '<td>'.$j.'×'.$i.'='.$i*$j.'</td>';

            }

            echo '</tr>';

        }

        return ;

        echo '</table>';

    }

    $a=test('green');

    echo $a;

?>


Dante
Dante

我可是要成为PHP大咖的人

reply all(1)
韦小宝

Take a look at the direct output to see if there is any color

  • reply Thank you, I found out last night that it was a problem with single quotes and double quotes. _(¦3 ∠)_ Single quotes are used outside the two lines of tr bgcolor, so the color is not parsed.
    Dante author 2019-02-15 10:30:29
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template