Posts Tagged ‘loops’

PHP While – Do While Loop

This item was filled under [ PHP & MySql, References ]

The While Loop is used to repeat executing a certain code as long as a given condition is (still) true. while( … condition … ) { … execute code … } The code between accolades is only executed when the condition between brackets is true ( just like the If Loop) however after it executed [...]

Continue reading...

Tagged with: [ , , , ]

PHP Foreach Loop

This item was filled under [ PHP & MySql, References ]

A total different kind of loop is the foreach loop. This loop is used to separately handle each sub-variable out of an array. Each sub-variable may be split into its name and its value. foreach($array AS $key => $value) { … execute code … } Each sub-variable of the array $array will be split into [...]

Continue reading...

Tagged with: [ , , , ]

PHP For Loop

This item was filled under [ PHP & MySql, References ]

The For loop is used to repeat executing a certain code for a specific amount of times. This could as well be done with the while loop however the for loop is made for this. The while loop may be used for much more complex stuff and for various other purposes. The for loop is [...]

Continue reading...

Tagged with: [ , , , ]

PHP If Loop

This item was filled under [ PHP & MySql, References ]

The If Loop is a very basic loop and used often. It’s used to check a condition and execute a code based on whether the condition was true or not. if( … condition … ) { … execute code … }else{ … execute other code … } The condition is put between brackets and the [...]

Continue reading...

Tagged with: [ , , ]

PHP Loops

This item was filled under [ PHP & MySql, References ]

In PHP loops are used to execute codes under certain conditions and may also be used to repeat the code. There are different loops to do different kind of things: If loop The If loop is used to execute a certain code only when a certain condition is true. While loop The While loop is [...]

Continue reading...