Home >> PHP >> For loop in PHP

For loop in PHP

The for loop a block of code for certain number of times.

Syntax

for(initialization; condition; increment){
    // code to be executed
}

Example

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

Post Your Comment

Next Questions
While loop
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

Copyright ©2022 coderraj.com. All Rights Reserved.