You should always close a file in PHP using the fclose() function after you're done writing to it.
- TRUE
- FALSE
Absolutely! It is good practice in PHP to close the file after you have finished writing to it. This is done using the fclose() function, which releases the resources associated with the file and ensures proper cleanup. By closing the file, you also free up system resources and make them available for other operations.
Loading...
Related Quiz
- You have a PHP script and you need to read a file. How would you do this?
- Which of the following functions can be used in PHP to find the length of a string?
- A common use case for the $GLOBALS superglobal in PHP is to access global variables from within a function, which would otherwise be out of the function's ______.
- If you want to format a date in PHP, you can use the date() function where the first argument is the format string and the second argument is the ______.
- Which of the following are ways to use callback functions in PHP?