Advertisements
Advertisements
Question
What is For each loop in PHP?
Short/Brief Note
Advertisements
Solution
- For each loop is exclusively available in PHP.
- It works only with arrays. The loop iteration deepens on each KEY Value pair in the Array.
- For each, loop iteration the value of the current array element is assigned to $value variable and the array pointer is shifted by one, until it reaches the end of the array element.
shaalaa.com
Looping Structure
Is there an error in this question or solution?
APPEARS IN
RELATED QUESTIONS
Loops that iterate for fixed number of times is called ______.
What will be the output of the following PHP code?
<?php
for ($x = 1; $x < 10;++$x)
{
print “*\t”;
}
?>Define for loop in PHP.
Write Syntax of For loop in PHP.
Write Syntax of while loop in PHP.
Write Syntax of Do while loop in PHP.
Explain the use of for each loop in PHP.
Write the features Looping Structure.
Explain Looping Structure in PHP.
Explain working of loops in array.
