Can anyone give me some instructions on this assignment?
【H】™☆Ley
【H】™☆Ley 2017-06-02 10:30:36
0
6
1972

http://www.php.cn/code/1084.html

Can anyone give me some instructions on this assignment? It cannot be completed

【H】™☆Ley
【H】™☆Ley

reply all(6)
卖女孩的小火柴哟
<?php
    function renderTable($c0,$c1='red') {
        $table = '<table border="1">';
        for($i=1;$i<10;$i++) {
            // if ($i%2==0) {
            //     $table .= "<tr bgcolor={$c0}>";
            // } else {
            //     $table .= "<tr bgcolor={$c1}>";
            // }
            $table .= "<tr bgcolor='#$i(16-$i)$i'>";
            for($j=1;$j<10;$j++) {
                $table .= '<td>'.$i.'x'.$j.'='.$i*$j.'</td>';
            }
            $table .= '</tr>';
        }
        $table .= '</table>';
        return $table;
    }
    echo renderTable('blue');
?>

That’s it

不是铭跃

<?php

echo '<table>';

function demo($color1,$color="pink",$cor=10,$row=10){

    for($x=0;$x<$row;$x++){

        if($x%2==0){

            echo "<tr bgcolor='$color'>";

        }else{

           echo"<tr bgcolor='$color1'>";

        }

        for($y=0;$y<$cor;$y++){

            echo "<td>".($x.$y)."</td>";

        }

    echo "<tr>" ;   

    }


    return "<table>";


}


$demo=demo('red');

echo $demo;



?>


  • reply return "&lt;table&gt;"; Why is this paragraph written like this? ? It's not echo "&lt;/table&gt;"; I don't understand what it means? What role does it play?
    益伦 author 2017-10-16 15:25:58
【H】™☆Ley

QQ截图20170602145454.jpg

Can you complete this homework?

Thank you

  • reply I suggest you figure it out on your own. This is the simplest code logic in PHP, and if you can do it when you first learn it, it will be of great help and encouragement to you.
美食控

This course is not difficult. PHP functions have this fixed grammatical structure, just remember it

【H】™☆Ley

Just help me complete the required homework at the bottom

I don’t know how to do it

I am a newbie

Thank you! ! !

PHPzhong

Please be specific with your question, otherwise I won’t be able to help you!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!