PHP File Handling MCQs

PHP File Handling MCQs : This section focuses on "File Handling" in PHP. These Multiple Choice Questions (mcq) should be practiced to improve the PHP skills required for various interviews (campus interview, walk-in interview, company interview), placements, entrance exams and other competitive examinations.

1. The PHP ________ function is used to open a file.

A. open()
B. fopen()
C. create()
D. insert()

View Answer


2. fopen() requires _______ arguments.

A. 0
B. 1
C. 2
D. 3

View Answer


3. The purpose of r+ mode is?

A. Opens the file for reading and writing
B. Places the file pointer at the beginning of the file
C. Places the file pointer at the end of the file
D. Both A and B

View Answer


4. If an attempt to open a file fails then fopen returns a value of ?

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


5. The files length can be found using the _______function.

A. fsize()
B. fcount()
C. filesize()
D. count()

View Answer


6. Which of the following is true about a+ mode?

A. Opens the file for reading and writing only.
B. Places the file pointer at the end of the file.
C. If files does not exist then it attempts to create a file.
D. All of the above

View Answer


7. The filesize() function returns the file size in ___________

A. bits
B. bytes
C. kilobytes
D. gigabytes

View Answer


8. Which one of the following PHP function is used to determine a file’s last access time?

A. fileltime()
B. filectime()
C. fileatime()
D. filetime()

View Answer


9. What is the default value of max_input_time directive?

A. 30 seconds
B. 120 seconds
C. 1 second
D. 60 seconds

View Answer


10. Close the file with fclose() function.

A. Yes
B. No
C. Can be yes or no
D. Can not say

View Answer




Discussion



* You must be logged in to add comment.