You need to close a file in your PHP script after you're done with it. How would you do this?

  • close()
  • fclose()
  • end()
  • finish()
To close a file in a PHP script, you would use the fclose() function. It takes the file handle obtained from fopen() as its parameter. This function releases the resources associated with the file and frees up memory. It is a good practice to close files after you have finished working with them to ensure proper cleanup and prevent resource leaks.
Add your answer
Loading...

Leave a comment

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