PHP File Handling
PHP File Handling - Important Points
16. | Which of the following is the correct way to open a file in PHP in binary mode? |
---|
A. fopen("file.bin", "rb");
B. fopen("file.bin", "r");
C. fopen("file.bin", "w");
D. fopen("file.bin", "a");
View Answer Discuss Work SpaceAnswer: option a
Explanation:
17. | What is the function used to read a single character from a file in PHP? |
---|
A. fgetc()
B. fgets()
C. fread()
D. fgetss()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
18. | Which of the following is the correct way to check the end of a file in PHP? |
---|
A. feof($file)
B. eof($file)
C. end_of_file($file)
D. is_eof($file)
View Answer Discuss Work SpaceAnswer: option a
Explanation:
19. | Which of the following is the correct way to rename a file in PHP? |
---|
A. rename("oldname.txt", "newname.txt");
B. move("oldname.txt", "newname.txt");
C. change("oldname.txt", "newname.txt");
D. switch("oldname.txt", "newname.txt");
View Answer Discuss Work SpaceAnswer: option a
Explanation:
20. | What is the function used to read a specific number of bytes from a file in PHP? |
---|
A. fread()
B. fgetc()
C. fgets()
D. fgetss()
View Answer Discuss Work SpaceAnswer: option a
Explanation: