File and Directory Handling - file open-close, copy, rename, delete, directory operations, file upload-download - Online Test

30:00
1. Which PHP function is used to open a file and return a file pointer?
2. What is the primary purpose of the 'r' mode when opening a file with fopen()?
3. Which mode in fopen() is used to open a file for writing only; place the file pointer at the beginning of the file and truncate the file length to 0?
4. To append data to a file, which mode should be used with fopen()?
5. What does the 'b' modifier in file opening modes (e.g., 'rb', 'wb') signify?
6. Which PHP function is used to close an open file pointer?
7. What is the return value of fclose() upon successful closure of a file?
8. Which PHP function is used to copy a file from one location to another?
9. The copy() function returns TRUE on success and FALSE on failure. What happens if the destination file already exists?
10. Which PHP function is used to rename or move a file?

Test Results

0/0