MCQGeeks
0 : 0 : 1
CBSE
JEE
NTSE
NEET
English
UK Quiz
Quiz
Driving Test
Practice
Games
Quiz
PHP
File System
Quiz 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Q.1
The ............ function checks if the "end-of-file" (EOF) has been reached.
f_eof()
f_of()
feofs()
feof()
Q.2
The ........... function is used to read a single character from a file.
fgetc()
fgets()
fget()
fgetf()
Q.3
What is the purpose of basename() function?
Returns the last accessed time of the file
Returns the first accessed time of the file
Strips of the path and returns the file name
Strips of the path and returns the folder name
Q.4
What should you do if your script is having problem recognizing file endings from a text file saved on a platform different from the one you’re reading it on?
Change the auto_detect_line_endings INI setting
Use a regular expression to detect the last letter of a line
Use fpos()
Use ftok()
Read the file one character at a time
Q.5
Which of the following functions retrieve the entire contents of a file in such a way that it can be used as part of an expression?
1. file_get_contents()
2. fgets()
3. fopen()
4. file()
5. readfile()
Option 2 and 4
Option 1 and 5
Option 1 and 4
Option 3 and 4
Q.6
fgets() is used to read a file one line at a time.
True
False
Q.7
Which one of the following function operates similarly to fgets(), except that it also strips any HTML and PHP tags form the input?
fgetsh()
fgetsp()
fgetsa()
fgetss()
Q.8
Which one of the following function outputs the contents of a string variable to the specified resource?
filewrite()
fwrite()
filewrites()
fwrites()
Q.9
Which function sets the file filename’s last-modified and last-accessed times?
sets()
set()
touch()
touched()
Q.10
What is the difference between stat() and fstat()?
While stat() works on open file pointers, fstat() works on files specified by pathname
While fstat() works on open file pointers, stat() works on files specified by pathname
fstat() has nothing to do with files
stat() has nothing to do with files
fstat() is an alias of stat()
Q.11
flock() is used to unlock a file so that two or more people do not get access to it at the same time.
True
False
Q.12
Which of the following functions reads the entire contents of a file?
1. fgets()
2. file_get_contents()
3. fread()
4. readfile()
5. file()
Option 3 and 5
Option 1, 3 and 4
Option 2, 4 and 5
Option 2 and 4
Q.13
Which function is useful when you want to output the executed command’s result?
out_cmm()
out_system()
cmm()
system()
Q.14
Which one of the following function reads a directory into an Array?
scandir()
readdir()
scandirectory()
readdirectory()
0 h : 0 m : 1 s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Report Question
×
What's an issue?
Question is wrong
Answer is wrong
Other Reason
Want to elaborate a bit more? (optional)
Support mcqgeeks.com by disabling your adblocker.
×
Please disable the adBlock and continue.
Thank you.
Reload page