What is the break statement used for in PHP?

  • Terminating the execution of a loop or switch statement
  • Skipping the current iteration of a loop
  • Returning a value from a function
  • Displaying an error message
The correct option is: "Terminating the execution of a loop or switch statement." In PHP, the break statement is used to exit the current loop or switch statement. It is commonly used when a certain condition is met, and you want to stop the execution of the loop or switch immediately. Learn more: https://www.php.net/manual/en/control-structures.break.php
Add your answer
Loading...

Leave a comment

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