开发者

Simple PHP counter - how to print numbers with loop?

How can I print out the numbers from 0 to 20 with a loop in PHP?

I hope some one can help.

Thank开发者_开发知识库s!


You want a for loop: http://php.net/manual/en/control-structures.for.php


Use a for loop:

for ($i = 0; $i <= 20; $i++)
{
    echo $i . "\n";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜