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. Which in-built function will add a value to the end of an array?

array_unshift()
into_array()
inend_array()
array_push()

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. How many main parameter are used in for loop?

2
3
4
1

4. The filesize() function returns the file size in ___________

bits
bytes
kilobytes
gigabytes

5. Which of the following will be output of the following code?

<?php
function myTest() {
    static $x;
    echo $x;
}

myTest();

?> 

0
1
No Output
Error

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

<?php
$a = 1;
$b = 2;
$c = 3;
echo ($a * (($b) - $c));
?>

1
-1
2
-2

7. Which of the following function is used to get the value of the previous element in an array?

last()
before()
prev()
previous()

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

TRUE
FALSE
Can be true or false
Can not say

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

<?php   
  $arr = array (10, 20, 30); 
    foreach ($arr as $val) {  
        echo "$val1 \n"; 
    }  
?>

10 20 30
No Output
10
undefined variable

10. In how many ways we can create strings in PHP?

1
2
3
4

Results