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

Опубликовано: 27 Сентябрь 2016
на канале: 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...  
~-~~-~~~-~~-~


На этой странице сайта вы можете посмотреть видео онлайн PHP Tutorial - 13 - php for loop - php foreach loop- how to create for loop in php длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Online Classes 27 Сентябрь 2016, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 2,515 раз и оно понравилось 16 зрителям. Приятного просмотра!