Which function is used to close a file in PHP?
- 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
- How can you create a file in PHP?
- To access data from the $_GET superglobal in PHP, you can use $_GET['parameter'] where 'parameter' is the name of the ______ you wish to access.
- You have a PHP script and you need to validate an email address. How would you do this using Regular Expressions in PHP?
- What is the purpose of the htmlspecialchars() function in PHP?
- In PHP, the values in an array are always stored in the order in which they were added.