> for Statement in php ~ Online tutorial

for Statement in php

for Statement
The for statement is used when you know how many times you want to execute a statement or a list of statements.
Syntax
for (initialization; condition; increment)
{
code to be executed;
}

Note:

The for statement has three parameters. The first parameter initializes variables, the second parameter holds the condition, and the third parameter contains the increments required to implement the loop. If more than one variable is included in the initialization or the increment parameter, they should be separated by commas. The condition must evaluate to true or false.
Example

<html>
<body>
<?php
for ($i=1; $i<=5; $i++)
 {
 echo "Hello World!";
}
?>

≤html>
Output
Hello World
Hello World
Hello World
Hello World
Hello World

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: