filmov
tv
For and foreach loop in PHP with break statement and creating patterns using nested for loops

Показать описание
00:41 for loop basic syntax
02:53 for loop with break
05:53 foreach loop
09:23 nested for loop
12:53 creating patterns
There are three statements while creating a for loop. The first expression initialize the loop, the second expression checks for logical out put like True or False and the third expression usually used as counter increment but any statement can be executed here.
The statements inside the loop is executed on each iteration.
By using break statement inside the loop we can prematurely exist the loop. This break statement is usually connected to one if statement.
The third expression which is used to increment the counter is used to increase or decrease the step value of the counter.
foreach loop is used to pass through all the elements of the array.
Condition checking is done at the starting of each loop so efficient way of checking will improve the performance of the script.
Nested loops are used where loops are used inside the loop and various patterns can be generated by using this loop.
Download source code from here
#forLoop #phpForLoop #LoopsInPhp #Looping #PHP #plus2net #PhpBasicLoops
02:53 for loop with break
05:53 foreach loop
09:23 nested for loop
12:53 creating patterns
There are three statements while creating a for loop. The first expression initialize the loop, the second expression checks for logical out put like True or False and the third expression usually used as counter increment but any statement can be executed here.
The statements inside the loop is executed on each iteration.
By using break statement inside the loop we can prematurely exist the loop. This break statement is usually connected to one if statement.
The third expression which is used to increment the counter is used to increase or decrease the step value of the counter.
foreach loop is used to pass through all the elements of the array.
Condition checking is done at the starting of each loop so efficient way of checking will improve the performance of the script.
Nested loops are used where loops are used inside the loop and various patterns can be generated by using this loop.
Download source code from here
#forLoop #phpForLoop #LoopsInPhp #Looping #PHP #plus2net #PhpBasicLoops