Question 1. The filesize() function returns the file size in ___________
bits
bytes
kilobytes
gigabytes
Explanation:-
Answer: Option B. -> bytes
Question 2. Which one of the following function is capable of reading a specific number of characters form a file?
fgets()
fget()
fileget()
filegets()
Explanation:-
Answer: Option A. -> fgets() Its prototype is string fgets(resource handle [, int length]). If the optional length parameter is omitted, 1024 character is assumed.
Question 3. Which one of the following function is capable of reading a file into an array?
file()
arrfile()
arr_file()
file_arr()
Explanation:-
Answer: Option A. -> file()
Question 4. Which one of the following PHP function is used to determine a file’s last access time?
fileltime()
filectime()
fileatime()
filetime()
Explanation:-
Answer: Option C. -> fileatime() The fileatime() function returns a file’s last access time in Unix timestamp format or FALSE on error.
Question 5. Which one of the following function is capable of reading a file into a string variable?
file_contents()
file_get_contents()
file_content()
file_get_content()
Explanation:-
Answer: Option B. -> file_get_contents()
Question 6. 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()
Explanation:-
Answer: Option D. -> fgetss()
Question 7. Which one of the following function outputs the contents of a string variable to the specified resource?
filewrite()
fwrite()
filewrites()
fwrites()
Explanation:-
Answer: Option B. -> fwrite()
Question 8. Which one of the following function reads a directory into an Array?
scandir()
readdir()
scandirectory()
readdirectory()
Explanation:-
Answer: Option A. -> scandir() It returns an array consisting of files and directories found in directory or returns FALSE on error.
Question 9. Which function sets the file filename’s last-modified and last-accessed times?
sets()
set()
touch()
touched()
Explanation:-
Answer: Option C. -> touch() Its prototype is int touch(string filename [, int time [, int atime]]). It returns TRUE on success or FALSE on error.
Question 10. Which function is useful when you want to output the executed command’s result?