Home >Backend Development >PHP Tutorial >Android programmers learn PHP development (14)-whlie exercises-PhpStorm

Android programmers learn PHP development (14)-whlie exercises-PhpStorm

黄舟
黄舟Original
2017-03-02 10:18:04919browse

Please indicate the source for reprinting: http://www.php.cn/
If you find the blog post useful, please like it, comment it, and follow it, thank you! ~


In fact, compared to whlie, I prefer to use for. Here we practice the table form together. Take a look at the GIF dynamic rendering, and take a look at the code:
There is no new knowledge point, so there are no comments in the code. For novice friends who don’t know what to ask, let’s learn php~~


<?php

    $i = 0;
    while (true){
        echo "{$i}<br>";
        $i++;
        if ($i > 10){
            break;
        }
    }

    /** ***********************分割线************************* */
    echo "<table border=&#39;1&#39; align=&#39;center&#39; width=&#39;100&#39;>";
    echo "<caption><h3>iwanghang</h3></caption>";
    $i = 0;
    while ($i < 10){
        echo "<tr><td>{$i}</td></tr>";
        $i++;
    }
    echo "</table>";

    /** ***********************分割线************************* */
    echo "<table border=&#39;1&#39; align=&#39;center&#39; width=&#39;100&#39;>";
    echo "<caption><h3>iwanghang</h3></caption>";
    $i = 0;
    while ($i < 100){
        if ($i % 10 == 0){
            echo "<tr>";
        }
        echo "<td>{$i}</td>";
        $i++;
        if ($i % 10 == 0){
            echo "</tr>";
        }
    }
    echo "</table>";

    /** ***********************分割线************************* */
    $i = 0;
    while ($i < 10){
        echo "#";
        $i++;
    }
    echo "<br>";

    /** ***********************分割线************************* */
    echo "<table border=&#39;1&#39; align=&#39;center&#39; width=&#39;100&#39;>";
    echo "<caption><h3>whlie练习</h3></caption>";
    $i = 0;
    while ($i <10){
        $j = 0;

        if ($i%2==0){
            echo &#39;<tr bgcolor="#999999">&#39;;
        }else{
            echo &#39;<tr>&#39;;
        }

        while ($j < 10){
            echo "<td>$j</td>";
            $j++;
        }

        $i++;
    }
    echo "</table>";


The above is for Android programmers to learn PHP development (14)-whlie exercises-PhpStorm Content, please pay attention to the PHP Chinese website (www.php.cn) for more related content!



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn