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

Publicado el: 27 septiembre 2016
en el canal de: 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...  
~-~~-~~~-~~-~


En esta página del sitio puede ver el video en línea PHP Tutorial - 13 - php for loop - php foreach loop- how to create for loop in php de Duración hora minuto segunda en buena calidad , que subió el usuario Online Classes 27 septiembre 2016, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 2,515 veces y le gustó 16 a los espectadores. Disfruta viendo!