Php File System(Engineering > Computer Science And Engineering > Php ) Questions and Answers

Question 1. Which one of the following function is capable of reading a specific number of characters form a file?
  1.    filegets()
  2.    fget()
  3.    fgets()
  4.    fileget()
Explanation:-
Answer: Option C. -> fgets()

Question 2. Which one of the following PHP function is used to determine a file’s last access time?
  1.    fileatime()
  2.    filetime()
  3.    filectime()
  4.    fileltime()
Explanation:-
Answer: Option A. -> fileatime()

Question 3. Which one of the following function is capable of reading a file into a string variable?
  1.    file_contents()
  2.    file_get_contents()
  3.    file_content()
  4.    file_get_content()
Explanation:-
Answer: Option B. -> file_get_contents()

Question 4. Which one of the following function is capable of reading a file into an array?
  1.    file_arr()
  2.    arrfile()
  3.    file()
  4.    arr_file()
Explanation:-
Answer: Option C. -> file()

Question 5. The filesize() function returns the file size in ___________
  1.    bytes
  2.    gigabytes
  3.    bits
  4.    kilobytes
Explanation:-
Answer: Option A. -> bytes

Question 6. Which function sets the file filename’s last-modified and last-accessed times?
  1.    touched()
  2.    sets()
  3.    touch()
  4.    set()
Explanation:-
Answer: Option C. -> touch()

Question 7. Which one of the following function operates similarly to fgets(), except that it also strips any HTML and PHP tags form the input?
  1.    fgetss()
  2.    fgetsh()
  3.    fgetsp()
  4.    fgetsa()
Explanation:-
Answer: Option A. -> fgetss()

Question 8. Which one of the following function outputs the contents of a string variable to the specified resource?
  1.    filewrite()
  2.    fwrites()
  3.    filewrites()
  4.    fwrite()
Explanation:-
Answer: Option D. -> fwrite()

Question 9. Which function is useful when you want to output the executed command’s result?
  1.    out_cmm()
  2.    system()
  3.    cmm()
  4.    out_system()
Explanation:-
Answer: Option B. -> system()

Question 10. Which one of the following function reads a directory into an Array?
  1.    scandirectory()
  2.    readdir()
  3.    readdirectory()
  4.    scandir()
Explanation:-
Answer: Option D. -> scandir()