Which of the following are ways to include a file in PHP?
- include() and require()
- require_once() and include()
- include_once() and require_once()
- include() and include_once()
The correct options for including a file in PHP are include() and require(). Both statements allow you to include a file into the current PHP script. require_once() and include_once() also provide similar functionality, but they ensure that the file is included only once to avoid redundancy.
Loading...
Related Quiz
- How is the comparison of objects done in PHP?
- What can be potential issues when working with the $_GET superglobal in PHP?
- You have a PHP script and you need to access data sent via the POST method from a form. How would you do this using the $_POST superglobal?
- What is a common use case for Regular Expressions in PHP?
- The PHP interpreter executes comments as part of the script.