In PHP, after you have finished working with a file, you should always close it using the ______ function.
- close()
- fclose()
- end()
- finish()
In PHP, the fclose() function is used to close a file. 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.
Loading...
Related Quiz
- The switch statement in PHP can only test a single condition.
- How do you insert data into a MySQL table using PHP?
- PHP superglobals are only accessible within functions.
- In PHP, which keyword is used to define a constant?
- How can you handle file uploads in PHP? Discuss the steps involved and best practices to ensure security and validation.