PHP Tutorial - 13 - php for loop - php foreach loop- how to create for loop in php

Veröffentlicht am: 27 September 2016
auf dem Kanal: Online Classes
2,515
16

PHP Loops
Often when you write code, you want the same block of code to run over and over again in a row. Instead of adding several almost equal code-lines in a script, we can use loops to perform a task like this.

In PHP, we have the following looping statements:

while - loops through a block of code as long as the specified condition is true
do...while - loops through a block of code once, and then repeats the loop as long as the specified condition is true
for - loops through a block of code a specified number of times
foreach - loops through a block of code for each element in an array
Parameters:

init counter: Initialize the loop counter value
test counter: Evaluated for each loop iteration. If it evaluates to TRUE, the loop continues. If it evaluates to FALSE, the loop ends.
increment counter: Increases the loop counter value

The PHP foreach Loop
The foreach loop works only on arrays, and is used to loop through each key/value pair in an array.

~-~~-~~~-~~-~
Please watch: "Php hacks : How to create website step by step using php and mysql : part 8"
   • Php hacks : How to create website ste...  
~-~~-~~~-~~-~


Auf dieser Seite können Sie das Online-Video PHP Tutorial - 13 - php for loop - php foreach loop- how to create for loop in php mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Online Classes 27 September 2016 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 2,515 Mal angesehen und es wurde von 16 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!