You have a loop in your PHP script and you want to skip the rest of the current iteration and move on to the next one if a certain condition is met. How would you do this using continue?

  • Use the continue statement to skip the rest of the current iteration and move to the next iteration.
  • Use the break statement to terminate the loop execution.
  • Use the exit statement to stop the script execution.
  • Use the return statement to exit the loop and return a value.
The correct option is: "Use the continue statement to skip the rest of the current iteration and move to the next iteration." The continue statement in PHP is used to skip the remaining code in the current iteration of the loop and move to the next iteration. It allows you to bypass further execution within the current iteration based on a certain condition. Learn more: 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 *