PHP Loop Statements Quiz – Immediate Feedback
1. Which of the following is NOT a type of loop statement in PHP?
2. What type of loop is “for loop” in PHP?
3. What is the syntax for for loop in PHP?
4. What are the three parts of the for loop syntax in PHP?
5. When is the ‘initialization’ part of a for loop executed?
6. What is the purpose of the ‘increment’ part of a for loop?
7. What type of loop is “while loop” in PHP?
8. What type of loop is “do...while loop” in PHP?
9. Which looping structure should be used to iterate over elements of an array in PHP?
10. What is the output of the following code?
$array = array(1, 2, 3, 4, 5); foreach ($array as $value) { echo $value; }