search
Homephp教程PHP源码php while loop next

<script>ec(2);</script>

php while loop next

循环执行的代码块中指定的次数,或在指定的条件为真。


-------------------------------------------------- ------------------------------

PHP的循环
很多时候,当您编写代码,您希望相同的代码块来运行十多年,再行。而不是添加在脚本中我们可以使用循环来执行这样的任务数几乎相等线。

在PHP中,我们有以下循环语句:

同时通过一个代码块 - 循环,而指定的条件为真
不...而 - 遍历一个代码块一次,然后重复像长循环指定的条件为真
为 - 循环通过一个代码块中指定的次数
Foreach源 - 通过对每个元素的代码块循环中的一个数组

-------------------------------------------------- ------------------------------

while循环
while循环执行的代码块,而条件是正确的。

语法

while (condition)
  {
  code to be executed;
  }

例如
下面的例子定义了一个循环,开始与i = 1。循环将继续运行,因为我只要小于或等于5。我将增加1每次循环运行:
html>

$i=1;
while($i   {
  echo "The number is " . $i . "
";
  $i++;
  }
?>


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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.