PHP Magic Book – Free PHP Scripts, Tutorials and Downloads, PHP AtoZ Reloaded, free php tutorials, free php downloads, php scripts, PHP tips

Archive for the ‘ For Loop ’ Category

Get Data As An Array – Download PHP Example

Array & Loop Example

Suppose we have a form and we want from user to select from a list of check boxes and check his favorite choices, post that data as an array and we want to display that data by calling array and arranging it in a loop. Then for this purpose consider following example.

(more…)

Tags: , , ,
Posted in: Arrays, For Loop, Scripts
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

PHP For Loop

For loop consists of three phases. i.e.

  • Define
  • Condition
  • Increment or decrement

First we define something. Then we apply a condition and then under that condition we increment or decrement that defined thing.

In complex way;
- The first part is an expression that is evaluated once when the loop begins.
- The second part is the condition. While the condition is true, the loop continues repeating. If the condition is false to start with, the following code block is not executed at all.
- The third part is an expression that is evaluated once at the end of each pass of the loop.

(more…)

Tags: , ,
Posted in: For Loop, Loops, PHP Basics
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Respond: Post A Comment

    


  Subscribe Via RSS
  Subscribe Via Email