Tutorial Study Image

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 - select the correct output of the PHP program? <?php $a = array(12, 5, 2); echo(array_product($a)); ?>

Show Answer
 Answer is : Option A

Q 2 - What is the output of the following PHP code? <?php $team = "programming"; switch ($programming) { case "php": echo "php"; case "Java": echo "Java"; case "Python": echo "python"; } ?>

Show Answer
 Answer is : Option C

Q 3 - what will print the output as $y?

Show Answer
 Answer is : Option A

Q 4 - Who is called the father of PHP language?

Show Answer
 Answer is : Option C

Q 5 - Suggest the correct output for the PHP code? <?php $a = 100; if ($a > 10) printf("Java"); else if ($a > 20) printf("Python"); else if($a > 30) printf("HTML"); ?>

Show Answer
 Answer is : Option A

Q 6 - Select the PHP code snippet output from below? <?php $var1 = abcd; $var2 = (array) $var1; echo $var2[0]; ?>

Show Answer
 Answer is : Option C

Q 7 - Guess the output pf the PHP code? <?php "Hello World" ?>

Show Answer
 Answer is : Option C

Q 8 - Select the correct method to define variables in PHP?

Show Answer
 Answer is : Option B

Q 9 - Find the output of the given code? <?php $a = "hello"; $a .= "world"; echo "$a"; ?>

Show Answer
 Answer is : Option C

Q 10 - How to display the "Hello world" program in PHP?

Show Answer
 Answer is : Option D