Welcome to Great Excess arrow Website arrow php - website arrow PHP - for Function Control
Saturday, 06 September 2008
 
 
English Language
Bahasa Indonesia
Computer
Website
Gallery
Health
Ebook
Tips
Movies
Add Site
Directory Listing

Visitor Data
Your IP
38.103.63.59
United States United States :
Browser
Unknown Browser Unknown Browser
Operating System
Unknown Operating System Unknown Operating System

PHP - for Function Control | Print |
 


A for loop is a more complex looping construct than the simple while loop:

for(start_expr; cond_expr; iter_expr) {
statements
}

for(start_expr; cond_expr; iter_expr):
statements
endfor;

A for loop takes three expressions. The first is the start expression; it is evaluated once when the loop begins. This is generally used for initializing a loop counter. The second expression is a conditional expression that controls the iteration of the loop. This expression is checked prior to each iteration. The third expression, the iterative expression, is evaluated at the end of each iteration and is typically used to increment the loop counter. With the first form of the for statement, you can omit the braces if you only need to execute a single statement.

The break and continue statements work with a for loop like they do with a while loop, except that continue causes the iterative expression to be evaluated before the loop conditional expression is checked.

 

This entry was posted on . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a comment.
Users' Comments (0)

Comment an article
  Name
  E-mail
   Title
Available characters: 600
This image contains a scrambled text, it is using a combination of colors, font size, background, angle in order to disallow computer to automate reading. You will have to reproduce it to post on my homepage
Enter what you see:

No comment posted

 
Top! Top!