";}$TmpArray = ["A","B","C","D"];foreach($TmpArrayas$i){echo$i . "
";}?>foreach loop iterates the array, Different from common usage, foreach in C++"/> ";}$TmpArray = ["A","B","C","D"];foreach($TmpArrayas$i){echo$i . "
";}?>foreach loop iterates the array, Different from common usage, foreach in C++">

Home >Backend Development >PHP Tutorial >Introduction to PHP 1 for loop

Introduction to PHP 1 for loop

WBOY
WBOYOriginal
2016-07-28 08:28:09882browse

<code><span><span><?php</span><span>$x</span> = <span>$_GET</span>[<span>'name'</span>];
    <span>echo</span><span>$x</span>;
    <span>for</span>(<span>$i</span> =<span>$x</span>;<span>$i</span><<span>100</span>;<span>$i</span>++)
    {
        <span>echo</span><span>$i</span>,<span>"<br>"</span>;
    }

    <span>$TmpArray</span> = [<span>"A"</span>,<span>"B"</span>,<span>"C"</span>,<span>"D"</span>];
    <span>foreach</span>(<span>$TmpArray</span><span>as</span><span>$i</span>)
    {
        <span>echo</span><span>$i</span> . <span>"<br>"</span>;
    }



<span>?></span></span></code>

foreach loop iterates the array, which is different from the common usage, in C++
foreach (zero-time variable in array)
php:
foreach (array as zero-time variable)

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above has introduced PHP entry 1 for loop, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

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