PHP Programming Quiz


Play this quiz that will help you to excel in PHP certification exams, placements etc. This PHP programming quiz consist of 10 questions that you need to solve in 10 minutes. We’ve specially designed this quiz so that you can quickly acquaint to the pattern of questions you can be asked in placement drives, certification exams etc. This PHP programming test enables you to assess your knowledge of PHP programming.

Take the Free Practice Test



PHP MCQs

Practice PHP MCQ Questions, which will help you to clear your PHP Programming related concepts and also helps you to prepare for placements, technical rounds, interviews, competitive exams etc.

PHP Quiz

Try Free PHP Quiz, to start a quiz you need to login first, after login you will get start quiz button and then by clicking on that you can start quiz. You will get 10 Minutes to answer all questions.

PHP Quiz

1. do-while loop is an _____ control loop ?

exit
exist
easy
entry

2. Logical AND operator : If both the operands are true then condition becomes true.

TRUE
FALSE
Can be true or false
Can not say

3. PHP files can contain ________ code.

text
HTML
python
Both A and B

4. Variables are ________ for storing information.

decimal
storage
numbers
containers

5. What will be the output of the following PHP code?

<?php 
   $url = "lfc123456@example.com";
   echo ltrim(strstr($url, "@"),"@");
?>

lfc123456@example.com
lfc123456
lfc123456@
example.com

6. PHP can create, open, read, write, delete, and close files on the server.

True
False
PHP can only create, open and close files on the server
PHP can read, write and delete files on the server

7. What is the use of array_unshift() function?

Function is used to print the array in readable format.
Adds elements to the beginning of the array and returns the size of array.
Function can be used to verify if a variable is an array. Returns TRUE or FALSE
Adds elements to the end of the array and returns the size of array.

8. How to destroy the session?

session_reset()
session_destroy()
session_end()
session_kill()

9. Rimo is handling the exception raised by Nanda and wants to print the appropriate error message and code. Identify the correct catch block

catch() { echo getMessage(); echo getCode(); }
catch(Exception $e) { echo $e->getMessage(); echo $e->getCode(); }
catch(Exception $e) { echo "Message:Uninitialized Variable"; echo "Code:5"; }
None of the above

10. How many main types of caching is there?

2
3
4
5

Results