Which PHP function can be used to write a string to a file?

  • fwrite()
  • file_put_contents()
  • file_get_contents()
  • file_open()
The file_put_contents() function in PHP is used to write a string to a file. It simplifies the process of opening a file, writing data, and closing the file, making it a convenient option for file writing operations.
Add your answer
Loading...

Leave a comment

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