Which of the following functions can be used to read the contents of a file in PHP?

  • fread() and file_get_contents()
  • fwrite() and file_put_contents()
  • fopen() and fclose()
  • print() and echo()
The functions fread() and file_get_contents() can be used to read the contents of a file in PHP. fread() reads a file using a file pointer obtained from fopen(), while file_get_contents() reads the entire file into a string. The other options mentioned are not specifically used for reading file contents.
Add your answer
Loading...

Leave a comment

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