Advertisements
Advertisements
Question
Explain the use of for each loop in PHP.
Short/Brief Note
Advertisements
Solution
- The foreach loop works only on arrays,
- It is used to loop through each key/value pair in an array.
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 ______.
for ($ x=0; $ x<5; x++)
echo “Hai”
The above loop executes how many no of times?
PHP supports which types of looping techniques ______.
What will be the output of the following PHP code?
<?php
for ($x = -1; $x < 10;--$x)
{
print $x;
}
?>Define for loop in PHP.
Write the features Looping Structure.
Write the purpose of Looping Structure in PHP.
Differentiate For each and While loop.
Discuss in detail about Foreach loop.
Explain the process Do while loop.
