Vidyalelo
PHP · all questions

File System
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

19

Questions

1/1

Page

Pick an option on a question to see the right answer and solution.

The filesize() function returns the file size in ___________

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which one of the following function is capable of reading a file into an array?

Select an option to see the answer and solution.

Which one of the following function is capable of reading a file into a string variable?

Select an option to see the answer and solution.

Which one of the following function is capable of reading a specific number of characters form a file?

Select an option to see the answer and solution.

Which one of the following function operates similarly to fgets(), except that it also strips any HTML and PHP tags form the input?

Select an option to see the answer and solution.

Which one of the following function outputs the contents of a string variable to the specified resource?

Select an option to see the answer and solution.

Which function sets the file filename’s last-modified and last-accessed times?

Select an option to see the answer and solution.

Which function is useful when you want to output the executed command’s result?

Select an option to see the answer and solution.

Which one of the following function reads a directory into an Array?

Select an option to see the answer and solution.

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()

Select an option to see the answer and solution.

fgets() is used to read a file one line at a time.

Select an option to see the answer and solution.

What is the difference between stat() and fstat()?

Select an option to see the answer and solution.

flock() is used to unlock a file so that two or more people do not get access to it at the same time.

Select an option to see the answer and solution.

Which of the following functions reads the entire contents of a file?
1. fgets()
2. file_get_contents()
3. fread()
4. readfile()
5. file()

Select an option to see the answer and solution.

What is the purpose of basename() function?

Select an option to see the answer and solution.

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?

Select an option to see the answer and solution.

The ............ function checks if the "end-of-file" (EOF) has been reached.

Select an option to see the answer and solution.

The ........... function is used to read a single character from a file.

Select an option to see the answer and solution.