- 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 Mock Test
This section presents you various set of Mock Tests related to PHP. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
PHP Mock Test I
Q 1 - Which of the following is correct about PHP?
A - PHP is a recursive acronym for "PHP: Hypertext Preprocessor".
B - PHP is a server side scripting language that is embedded in HTML.
Answer : D
Explanation
All of the above options are correct.
Q 2 - Which of the following is correct about PHP?
C - You add, delete, modify elements within your database thru PHP.
Answer : D
Explanation
All of the above options are correct.
Q 3 - Which of the following is correct about PHP?
A - PHP can access cookies variables and set cookies.
B - Using PHP, you can restrict users to access some pages of your website.
Answer : D
Explanation
All of the above options are correct.
Q 4 - Using which of the following way can you embed PHP code in an HTML page?
A - <?php PHP code goes here ?>
Answer : D
Explanation
All of the above options are correct.
Q 5 - Which of the following is true about php.ini file?
Answer : C
Explanation
Both of the above options are correct.
Q 6 - Which of the following is true about php.ini file?
Answer : C
Explanation
Both of the above options are correct.
Answer : A
Explanation
false! PHP is whitespace insensitive means that it almost never matters how many whitespace characters you have in a row.one whitespace character is the same as many such characters.
Answer : B
Explanation
true! PHP is a case sensitive language.
Q 9 - Which of the following is true about php variables?
A - All variables in PHP are denoted with a leading dollar sign ($).
B - The value of a variable is the value of its most recent assignment.
Answer : D
Explanation
All of the above options are correct.
Q 10 - Which of the following is true about php variables?
A - Variables can, but do not need, to be declared before assignment.
C - Variables used before they are assigned have default values.
Answer : D
Explanation
All of the above options are correct.
Q 11 - Which of the following type of variables are whole numbers, without a decimal point, like 4195?
Answer : A
Explanation
Integers: are whole numbers, without a decimal point, like 4195.
Q 12 - Which of the following type of variables are floating-point numbers, like 3.14159 or 49.1?
Answer : B
Explanation
Doubles: are floating-point numbers, like 3.14159 or 49.1.
Q 13 - Which of the following type of variables have only two possible values either true or false?
Answer : C
Explanation
Booleans: have only two possible values either true or false.
Q 14 - Which of the following type of variables are special type that only has one value: NULL?
Answer : D
Explanation
NULL: is a special type that only has one value: NULL.
Q 15 - Which of the following type of variables are sequences of characters, like 'PHP supports string operations.'?
Answer : A
Explanation
Strings: are sequences of characters, like 'PHP supports string operations.'
Q 16 - Which of the following type of variables are named and indexed collections of other values?
Answer : B
Explanation
Arrays: are named and indexed collections of other values.
Q 17 - Which of the following type of variables are instances of programmer-defined classes?
Answer : C
Explanation
Objects: are instances of programmer-defined classes, which can package up both other kinds of values and functions that are specific to the class.
Q 18 - Which of the following type of variables are special variables that hold references to resources external to PHP (such as database connections)?
Answer : D
Explanation
Resources: are special variables that hold references to resources external to PHP (such as database connections).
Q 19 - Which of the following is correct about variable naming rules?
A - Variable names must begin with a letter or underscore character.
B - A variable name can consist of numbers, letters, underscores.
C - you cannot use characters like + , - , % , ( , ) . & , etc in a variable name.
Answer : D
Explanation
All of the above options are correct.
Q 20 - 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 21 - Which of the following is correct about determine the "truth" of any value not already of the Boolean type?
Answer : D
Explanation
All of the above options are correct.
Q 22 - Which of the following is correct about NULL?
A - NULL is a special type that only has one value: NULL.
B - The special constant NULL is capitalized by convention, but actually it is case insensitive.
Answer : C
Explanation
Both of the above options are correct.
Q 23 - Which of the following is correct about NULL?
A - A variable that has been assigned NULL evaluates to FALSE in a Boolean context.
B - A variable that has been assigned NULL returns FALSE when tested with IsSet() function.
Answer : C
Explanation
Both of the above options are correct.
Q 24 - Which of the following is correct about constants?
A - To define a constant you have to use define() function.
B - To retrieve the value of a constant, you have to simply specify its name.
Answer : C
Explanation
Both of the above options are correct.
Q 25 - Which of the following is correct about constants?
A - Unlike with variables, you do not need to have a constant with a $.
B - Only scalar data (boolean, integer, float and string) can be contained in constants.
Answer : C
Explanation
Both of the above options are correct.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | D |
2 | D |
3 | D |
4 | D |
5 | C |
6 | C |
7 | A |
8 | B |
9 | D |
10 | D |
11 | A |
12 | B |
13 | C |
14 | D |
15 | A |
16 | B |
17 | C |
18 | D |
19 | D |
20 | D |
21 | D |
22 | C |
23 | C |
24 | C |
25 | C |