PHP supports multiple types of loops. If you wanted to loop through a block of code if and as long a specified condition is true, which type of loop would you use?

✅  The correct answer is:

while

Question:

PHP supports multiple types of loops. If you wanted to loop through a block of code if and as long a specified condition is true, which type of loop would you use?

Solution:

  • for
  • do-while
  • while
  • foreach