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. What will be the output of the following PHP code?

<?php
$x = 1;
$y = 2;
$z = "$x + $y";
echo "$z";
?<

$x + $y
3
1+2
12

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

<?php 
    $title = "O malley wins the heavyweight championship!";
    echo ucwords($title);
?>

O Malley Wins The Heavyweight Championship!
O malley Wins The Heavyweight Championship!
O Malley wins the heavyweight championship!
o malley wins the heavyweight championship!

3. Which of the following is true about constant?

Once the Constants have been set, may not be redefined or undefined
Constants may be defined and accessed anywhere without regard to variable scoping rules
Constants cannot be defined by simple assignment, they may only be defined using the define() function
All of the above

4. How many types of functions are available in php?

5
4
3
2

5. There is no need to write a dollar sign ($) before a constant

TRUE
FALSE
Can be true or false
Can not say

6. _________ function is used to read a constant value.

read()
get()
constant()
define()

7. Objects are also known as ______.

reference
template
class
instances

8. Which of the following is not a built-in function in php ?

print_r()
fopen()
fclosed()
gettype()

9. A variable name can only contain ____________?

alphanumeric characters
underscores
Both A and B
None of the above

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

<?php
    $arr = array ("lets", "find", "course", ".Com");
    echo (array_search (".com", $arr) );
?>

0
Garbage value
3
No Output

Results