What is the continue statement used for in PHP?
- Skipping the remaining code in the current iteration of a loop
- Resuming the next iteration of a loop
- Breaking out of a switch statement
- Terminating the execution of a function
The correct option is: "Resuming the next iteration of a loop." In PHP, the continue statement is used to skip the remaining code in the current iteration of a loop and move on to the next iteration. It is commonly used when you want to skip certain iterations based on a condition. Learn more: https://www.php.net/manual/en/control-structures.continue.php
Loading...
Related Quiz
- You need to handle file uploads in your PHP script, including checking the size and type of the uploaded file and handling any upload errors. How would you do this?
- What is the purpose of the array_keys() function in PHP?
- The $GLOBALS superglobal in PHP is an associative array.
- The sort() function in PHP sorts an array in ______ order.
- The require statement in PHP will cause a fatal error if the file to be included is not found.