Which of the following are ways to open a file in PHP?

  • open() and read()
  • fopen() and fread()
  • include() and require()
  • file_open()
The correct way to open a file in PHP is by using the fopen() function. It takes the path to the file and the mode as parameters. This function returns a file handle or pointer that can be used for file operations. The other options mentioned are not valid for opening files in PHP.
Add your answer
Loading...

Leave a comment

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