Which of the following are common uses of break and continue in PHP loops?

  • Terminating the loop when a specific condition is met.
  • Skipping specific iterations based on certain conditions.
  • Breaking out of nested loops.
  • Continuing to the next iteration of the loop.
  • All the options
The correct options are: "Terminating the loop when a specific condition is met," "Skipping specific iterations based on certain conditions," and "Breaking out of nested loops." These are common use cases for break and continue statements, allowing you to control the loop flow based on specific conditions or requirements. Learn more: https://www.php.net/manual/en/control-structures.break.php, https://www.php.net/manual/en/control-structures.continue.php
Add your answer
Loading...

Leave a comment

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