What PHP function can be used to read a file?

  • readfile()
  • file_get_contents()
  • fread()
  • open()
The fread() function in PHP is used to read a file. It takes the file pointer and the number of bytes to read as arguments and returns the content of the file as a string. Alternatively, file_get_contents() can also be used to read the entire contents of a file into a string.
Add your answer
Loading...

Leave a comment

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