What is the purpose of the fclose() function in PHP?

  • To open a file
  • To read a file
  • To write to a file
  • To close a file
The fclose() function in PHP is used to close an open file. It releases the resources associated with the file and frees up memory. It is good practice to close a file after you have finished reading from or writing to it to ensure proper cleanup and avoid resource leaks.
Add your answer
Loading...

Leave a comment

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