what types of loops exist in php ?
what types of loops exist in php ?
|
PHP supports following four loop types. for − loops through a block of code a specified number of times. while − loops through a block of code if and as long as a specified condition is true. do...while − loops through a block of code once, and then repeats the loop as long as a special condition is true.
|
for
while do..while foreach |
PHP supports following four loop types. for − loops through a block of code a specified number of times. while − loops through a block of code if and as long as a specified condition is true. do...while − loops through a block of code once, and then repeats the loop as long as a special condition is true.
|
All that exist in all other languages:
For While Do While ForEach. |
PHP supports following four loop types.
for − loops through a block of code a specified number of times. while − loops through a block of code if and as long as a specified condition is true. do...while − loops through a block of code once, and then repeats the loop as long as a special condition is true. for each − loops through a block of code for each element in an array |
PHP supports following four loop types.
for − loops through a block of code a specified number of times. while − loops through a block of code if and as long as a specified condition is true. do...while − loops through a block of code once, and then repeats the loop as long as a special condition is true. |
Loops in PHP are used to execute the same block of code a specified number of times. PHP supports following four loop types.
for − loops through a block of code a specified number of times. while − loops through a block of code if and as long as a specified condition is true. do...while − loops through a block of code once, and then repeats the loop as long as a special condition is true. foreach − loops through a block of code for each element in an array. |
PHP supports following four loop types. for − loops through a block of code a specified number of times. while − loops through a block of code if and as long as a specified condition is true. do...while − loops through a block of code once, and then repeats the loop as long as a special condition is true.
|
php support four type of loops
1. for loop: mostly used to repeat a code for specified number of times. 2. while loop: use to repeat a code until the test condition remains true. 3. do-while loop: at least one time execution of code. after that code execution depends upon condition. 4: foreach: execute a block of code for each element of array |
Types of loops in PHP
1. for
2. while 3. do...while 4. foreach |
There are 3 types of loops are there in php.
1. For 2. While 3. Do while |
There are 4 types of loops in PHP and that are For Loop, While Loop, Do While Loop and foreach Loop. they are used to loop all the data or any record to do different tasks.
|
oops in PHP are used to execute the same block of code a specified number of times. PHP supports following four loop types.
for − loops through a block of code a specified number of times. while − loops through a block of code if and as long as a specified condition is true. do...while − loops through a block of code once, and then repeats the loop as long as a special condition is true. foreach − loops through a block of code for each element in an array. |
All times are GMT -7. The time now is 08:38 AM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.