Practice mode PHP

Which PHP loop is designed specifically to go through each element of an array?

Correct answer C. foreach

Explanation

The foreach loop iterates over each element of an array, for example foreach ($items as $item), without needing a counter or index.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.