- PHP Tutorial
- PHP - Home
- PHP - Introduction
- PHP - Environment Setup
- PHP - Syntax Overview
- PHP - Variable Types
- PHP - Constants
- PHP - Operator Types
- PHP - Decision Making
- PHP - Loop Types
- PHP - Arrays
- PHP - Strings
- PHP - Web Concepts
- PHP - GET & POST
- PHP - File Inclusion
- PHP - Files & I/O
- PHP - Functions
- PHP - Cookies
- PHP - Sessions
- PHP - Sending Emails
- PHP - File Uploading
- PHP - Coding Standard
- Advanced PHP
- PHP - Predefined Variables
- PHP - Regular Expression
- PHP - Error Handling
- PHP - Bugs Debugging
- PHP - Date & Time
- PHP & MySQL
- PHP & AJAX
- PHP & XML
- PHP - Object Oriented
- PHP - For C Developers
- PHP - For PERL Developers
- PHP Form Examples
- PHP - Form Introduction
- PHP - Validation Example
- PHP - Complete Form
- PHP login Examples
- PHP - Login Example
- PHP - Facebook Login
- PHP - Paypal Integration
- PHP - MySQL Login
- PHP AJAX Examples
- PHP - AJAX Search
- PHP - AJAX XML Parser
- PHP - AJAX Auto Complete Search
- PHP - AJAX RSS Feed Example
- PHP XML Example
- PHP - XML Introduction
- PHP - Simple XML
- PHP - Simple XML GET
- PHP - SAX Parser Example
- PHP - DOM Parser Example
- PHP Frame Works
- PHP - Frame Works
- PHP - Core PHP vs Frame Works
- PHP Design Patterns
- PHP - Design Patterns
- PHP Function Reference
- PHP - Built-In Functions
- PHP Useful Resources
- PHP - Questions & Answers
- PHP - Useful Resources
- PHP - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
PHP Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to PHP. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - Which of the following is true about php.ini file?
Answer : C
Explanation
Both of the above options are correct.
Q 2 - Which of the following is correct about determine the "truth" of any value not already of the Boolean type?
A - If the value is a number, it is false if exactly equal to zero and true otherwise.
Answer : D
Explanation
All of the above options are correct.
Q 3 - Which of the following is correct about constants vs variables in PHP?
A - Constants may be defined and accessed anywhere without regard to variable scoping rules.
B - Once the Constants have been set, may not be redefined or undefined.
Answer : C
Explanation
Both of the above options are correct.
Q 4 - Which of the following function is used to get length of a string?
Answer : B
Explanation
The strlen() function is used to find the length of a string.
Q 5 - Which of the following function is used to get environment variables in PHP?
Answer : D
Explanation
PHP provides a function getenv() to access the value of all the environment variables.
Q 6 - Singly quoted strings are treated almost literally, whereas doubly quoted strings replace variables with their values as well as specially interpreting certain character sequences.
Answer : A
Explanation
Singly quoted strings are treated almost literally, whereas doubly quoted strings replace variables with their values as well as specially interpreting certain character sequences.
Q 7 - Which of the following is used to delete a cookie?
Answer : A
Explanation
To delete a cookie you should call setcookie() with the name argument only.
Q 8 - Which of the following is an array containing information such as headers, paths, and script locations?
Answer : B
Explanation
$_SERVER − This is an array containing information such as headers, paths, and script locations. The entries in this array are created by the web server. There is no guarantee that every web server will provide any of these. See next section for a complete list of all the SERVER variables.
Q 9 - Which of the following is correct about preg_match() function?
Answer : C
Explanation
The preg_match() function searches string for pattern, returning true if pattern exists, and false otherwise.
Q 10 - Which of the following method can be used to create a MySql database using PHP?
Answer : B
Explanation
PHP uses mysql_query function to create a MySQL database.