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
Which loop evaluates condition expression as Boolean, if it is true, it executes statements and when it is false it will terminate?
Consider the following code
<? php
$count=12;
do{
printf(“%d squared=%d<br/>”,
$count, pow($count,2));
} while($count<4);
?>
What will be the output of the code.
Define Looping Structure in PHP.
Write Syntax of For loop in PHP.
Write Syntax of Do while loop in PHP.
Write the purpose of Looping Structure in PHP.
Write short notes on Do while Loop.
Explain Looping Structure in PHP.
Explain the process Do while loop.
Explain working of loops in array.
