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.
Loading...
Related Quiz
- The do...while loop in PHP will execute a block of code once, and then continue executing it as long as the ______ is true.
- What PHP function can be used to read a file?
- You need to process form data sent via the POST method in your PHP script. How would you do this using the $_POST superglobal?
- You have a while loop in your PHP script that is not terminating as expected. What could be the possible reasons and how would you debug this?
- You are writing a PHP script and you need to store multiple values in a single variable for easy manipulation. How would you do this using an array?