What PHP function can be used to write to a file?

  • readfile()
  • file_get_contents()
  • fwrite()
  • fopen()
The fwrite() function in PHP is used to write to a file. It takes the file handle obtained from fopen() as the first argument and the content to write as the second argument. It returns the number of bytes written or false on failure.
Add your answer
Loading...

Leave a comment

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