Home >> PHP >> While loop in PHP

While loop in PHP

The while loops through a block of code when condition is true.

Syntax

while (condition) {
    // Code to be executed;
}

Example

$i;
while($i<=10){
   echo $i++;
}

Post Your Comment

Next Questions
Do while loop
Foreach loop
Operators
Arithmatic operators
Assignment operators
Increment / Decrement Operators
Comparision Operators
Logical operators
Array Operators
String
addcslashes() function
addslashes() function
chunk_split() function
crc32() function
explode() function
implode() function
join() function
ltrim() function
md5() function
metaphone() function
money_format() function
nl2br() function
number_format() function
ord() function
parse_str() function

Copyright ©2022 coderraj.com. All Rights Reserved.