Beginner PHP
Q28 / 100

What does the foreach loop do in PHP?

Correct! Well done.

Incorrect.

The correct answer is B) Iterates over each key-value pair of an array

B

Correct Answer

Iterates over each key-value pair of an array

Explanation

foreach ($array as $key => $value) iterates over arrays and objects. foreach ($array as $value) skips the key.

Progress
28/100