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.
Loading...
Related Quiz
- To destroy a session in PHP, you can use the session_destroy() ______.
- To connect to a MySQL database in PHP, you can use the mysqli_connect function like $conn = mysqli_connect(______, _______, _______, ______);.
- You are writing a PHP script and you need to define an abstract class. How would you do this?
- What is the operator used for addition in PHP?
- You have a PHP script and you need to extend an abstract class. How would you do this?