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 functions that we used to compare the strings in PHP? 1) strcmp() 2) strcasecmp() 3) strspn() 4) strcspn()

Show Answer
 Answer is : Option D

Q 2 - In which PHP version the POSIX is implemented?

Show Answer
 Answer is : Option D

Q 3 - What is the correct syntax to add a one-line comment in PHP?

Show Answer
 Answer is : Option D

Q 4 - 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 5 - Mention the function in PHP to check the variable is an array or not?

Show Answer
 Answer is : Option B

Q 6 - Select the function in PHP that helps to compress strings

Show Answer
 Answer is : Option C

Q 7 - Guess the output of the PHP code? <?php if (0.1) print "Python" ; else print "php"; ?>

Show Answer
 Answer is : Option A

Q 8 - Select the functions that help to convert a string to uppercase in PHP? a) strtoupper() b) uppercase() c) str_uppercase() d) struppercase()

Show Answer
 Answer is : Option A

Q 9 - Guess the output of the following PHP code? <?php $tstudents = "25 students"; $mstudents = 10; $tstudents = $tstudents + $mstudents; echo "$tstudents"; ?>

Show Answer
 Answer is : Option D

Q 10 - what all are conditional statements in PHP?

Show Answer
 Answer is : Option D