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 - Guess the output of the following PHP code? <?php $var1 = 1; print($var1); print $var1; ?>

Show Answer
 Answer is : Option C

Q 2 - what is the use of print in PHP?

Show Answer
 Answer is : Option D

Q 3 - Select the correct output for the following PHP code <?php $cars = array("Toyota", "Benz", "Rolls"); echo "My car is a {$cars[0]}"; ?>

Show Answer
 Answer is : Option A

Q 4 - 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 5 - which are used to display the output in PHP?

Show Answer
 Answer is : Option D

Q 6 - Select the number of functions in PHP for searching and modifying strings using Perl-compatible?

Show Answer
 Answer is : Option B

Q 7 - Mention the output of the following PHP code <?php echo "Hello PHP </br> I love PHP"; ?>

Show Answer
 Answer is : Option C

Q 8 - How can we concatenate two variables in PHP?

Show Answer
 Answer is : Option D

Q 9 - select the correct output for the PHP code? <?php $x = 3.3; $y = 2; echo $x % $y; ?>

Show Answer
 Answer is : Option B

Q 10 - Mention the True statement about include and require in PHP?

Show Answer
 Answer is : Option C