logo
  • Home
  • About
  • Training
  • Programming
  • CS
  • IT
  • IS
  • ECE
  • EEE
  • EE
  • Civil
  • Mechanical
  • Chemical
  • Metallurgy
  • Instrumentation
  • Aeronautical
  • Aerospace
  • Biotechnology
  • Agriculture
  • MCA
  • BCA
  • Internship
  • Contact

PHP Multiple Choice Questions | MCQs | Quiz

PHP Interview Questions and Answers
Pratice PHP questions and answers for interviews, campus placements, online tests, aptitude tests, quizzes and competitive exams.

Get Started

•   Basics - 1
•   Basics - 2
•   Basics - 3
•   Functions
•   PHP In-Built Functions
•   Arrays - 1
•   Arrays - 2
•   Arrays - 3
•   Arrays - 4
•   Arrays - 5
•   Object Oriented PHP - 1
•   Object Oriented PHP - 2
•   Advanced Object Oriented
•   Error Handling
•   Exception Handling
•   PHP Filter
•   Regular Expressions - 1
•   Regular Expressions - 2
•   File System & PHP
•   Date & Timestamp
•   Working with Dates
•   HTML Forms
•   User Authentication
•   Uploading Files with PHP
•   PHP Networking
•   Session Handling - 1
•   Session Handling - 2
•   Website Security
•   Preg Basics
•   Databases Working - 1
•   Databases Working - 2
•   Object Basics - 1
•   Object Basics - 2
•   Updating & Deleting Entries
•   Image Uploading Ability
•   Object Advanced Features1
•   Object Advanced Features2
•   Object Advanced Features3
•   Object Tools - 1
•   Object Tools - 2
•   Object & Design - 1
•   Object & Design - 2
•   Syntax - 1
•   Syntax - 2
•   Variables - 1
•   Variables - 2
•   Variables - 3
•   Variables - 4
•   Echo
•   Print
•   Constants
•   Operators - 1
•   Operators - 2
•   Operators - 3
•   Operators - 4
•   Operators - 5
•   If-Else-If - 1
•   If-Else-If - 2
•   If-Else-If - 3
•   Switch
•   While Loops - 1
•   While Loops - 2
•   For Loops - 1
•   For Loops - 2
•   For Loops - 3
•   Functions - 1
•   Functions - 2
•   Functions - 3
•   Functions - 4
•   Functions - 5
•   Functions - 6

Best Reference Books

PHP Books
« Prev Page
Next Page »

PHP Questions & Answers – File System and PHP

Posted on May 22, 2013 by Manish

This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “File System and PHP”.

1. The filesize() function returns the file size in ___________
a) bits
b) bytes
c) kilobytes
d) gigabytes
View Answer

Answer: b
Explanation: None.

2. 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

Answer: c
Explanation: The fileatime() function returns a file’s last access time in Unix timestamp format or FALSE on error.

3. Which one of the following function is capable of reading a file into an array?
a) file()
b) arrfile()
c) arr_file()
d) file_arr()
View Answer

Answer: a
Explanation: None.

4. Which one of the following function is capable of reading a file into a string variable?
a) file_contents()
b) file_get_contents()
c) file_content()
d) file_get_content()
View Answer

Answer: b
Explanation: None.

5. Which one of the following function is capable of reading a specific number of characters form a file?
a) fgets()
b) fget()
c) fileget()
d) filegets()
View Answer

Answer: a
Explanation: Its prototype is string fgets(resource handle [, int length]). If the optional length parameter is omitted, 1024 character is assumed.

6. Which one of the following function operates similarly to fgets(), except that it also strips any HTML and PHP tags form the input?
a) fgetsh()
b) fgetsp()
c) fgetsa()
d) fgetss()
View Answer

Answer: d
Explanation: None.

7. Which one of the following function outputs the contents of a string variable to the specified resource?
a) filewrite()
b) fwrite()
c) filewrites()
d) fwrites()
View Answer

Answer: b
Explanation: None.

8. Which function sets the file filename’s last-modified and last-accessed times?
a) sets()
b) set()
c) touch()
d) touched()
View Answer

Answer: c
Explanation: Its prototype is int touch(string filename [, int time [, int atime]]). It returns TRUE on success or FALSE on error.

9. Which function is useful when you want to output the executed command’s result?
a) out_cmm()
b) out_system()
c) cmm()
d) system()
View Answer

Answer: d
Explanation: None.

10. Which one of the following function reads a directory into an Array?
a) scandir()
b) readdir()
c) scandirectory()
d) readdirectory()
View Answer

Answer: a
Explanation: It returns an array consisting of files and directories found in directory or returns FALSE on error.

Sanfoundry Global Education & Learning Series – PHP Programming.

To practice all questions on PHP Programming, here is complete set of 1000+ Multiple Choice Questions and Answers on PHP.

« Prev Page - PHP Questions & Answers – Strings and Regular Expressions – 2
» Next Page - PHP Questions & Answers – Date and Timestamp
« PHP Questions & Answers – Strings and Regular Expressions – 2
PHP Questions & Answers – Date and Timestamp »

Deep Dive @ Sanfoundry:

  1. Java Questions and Answers
  2. C Programming Examples on Searching and Sorting
  3. C# Programming Examples on LINQ
  4. C Programming Examples on Bitwise Operations
  5. C++ Questions and Answers
  6. C Tutorials
  7. C Programming Examples
  8. LISP Questions and Answers
  9. C# Programming Examples on Files
  10. Operating System Questions & Answers – File System Interface Access Methods – 2
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn | Facebook | Twitter | Google+

Best Careers

Developer Tracks
SAN Developer
Linux Kernel Developer
Linux Driver Developer
Linux Network Developer

Live Training Photos
Mentoring
Software Productivity
GDB Assignment
Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology
SAN II - Admin
Linux Fundamentals
Advanced C Training
Linux-C Debugging
System Programming
Network Programming
Linux Threads
Kernel Programming
Kernel Debugging
Linux Device Drivers

Best Reference Books

Computer Science Books
Algorithm & Programming Books
Electronics Engineering Books
Electrical Engineering Books
Chemical Engineering Books
Civil Engineering Books
Mechanical Engineering Books
Industrial Engineering Books
Instrumentation Engg Books
Metallurgical Engineering Books
All Stream Best Books

Questions and Answers

1000 C Questions & Answers
1000 C++ Questions & Answers
1000 C# Questions & Answers
1000 Java Questions & Answers
1000 Linux Questions & Answers
1000 Python Questions
1000 PHP Questions & Answers
1000 Hadoop Questions
Cloud Computing Questions
Computer Science Questions
All Stream Questions & Answers

India Internships

Computer Science Internships
Instrumentation Internships
Electronics Internships
Electrical Internships
Mechanical Internships
Industrial Internships
Systems Internships
Chemical Internships
Civil Internships
IT Internships
All Stream Internships

About Sanfoundry

About Us
Copyright
TOS & Privacy
Jobs
Bangalore Training
Online Training
SAN Training
Developers Track
Mentoring Sessions
Contact Us
Sitemap
© 2011 Sanfoundry