Home Yellow Pages Movies Classifieds Jokes Jobs Free Hosting Videos




For Loop

Loops is a programming structure that is used to execute one or more commands.

In "for" loop a variable is set to a initial value, there will be a condition for the loop to continue and an increment operator for the variable. It will be followed by commands.

The general structure for the "for" loop is

for (condition) { Commnads }

Example
<?php
for ($i=0; $i<6; $i++)  
{
echo $i."<BR>";
}
?>

In the above "for" loop the variable i is set to 0, the loop is executed till the condition is met. The variable changes according to the third argument. Each time the commands in brace bracket are executed. Here the echo command uses concatenation operator and thus the outputs are displayed in different lines.

Save the file as forloop.php, upload it to your web server and call in browser to get the result.

Back to Home
BizHat.com   Bookmark   Astrology   Chat Room   Classifieds   Computer   Downloads   Directory   Dating   Domain Tools   Education   eCards   Finance   Forums   Freelance Work   Free Hosting   Free Mail   Gallery   Games   Guest Book   Greeting Cards   Ham Radio   Health   Home Business   Hosting Tutorials   Hosting Directory   India   Jobs   Jokes   Kerala   Matrimonial   Music   Movies   News   News Letter   Recipes   Real Estate   Search   SMS   Tourist Guide   Top 100 Sites   Vote Us   Yellow Pages   Arthunkal Church   Site Map  

Google