Which of the following are true about the break and continue statements in PHP?
- The break statement is used to skip the rest of the loop iteration.
- The continue statement is used to terminate the current loop.
- The break statement is used to terminate the current loop.
- The continue statement is used to skip the rest of the loop iteration.
The correct option is: "The break statement is used to terminate the current loop." and "The continue statement is used to skip the rest of the loop iteration." These statements control the flow of a loop in PHP and allow you to interrupt the loop execution or skip certain iterations. Learn more: https://www.php.net/manual/en/control-structures.break.php, https://www.php.net/manual/en/control-structures.continue.php
Loading...
Related Quiz
- You need to sort an associative array in your PHP script based on its keys, in descending order. How would you do this?
- How do you connect to a MySQL database in PHP?
- What is the purpose of the array_search() function in PHP?
- What is the function func_num_args() used for?
- What are some FTP-related functions available in PHP?