PHP MCQs with answers Page - 19

Here, you will find a collection of MCQ questions on PHP. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 831.35K Points
Coach

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

Code:
<?php
$m = 8;
echo $m = ++$m % 9 + ++$m; 
?>
  • (A) 10
  • (B) 9
  • (C) 8
  • (D) Error

A

Admin • 831.35K Points
Coach

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

Code:
<?php
$n = 15;
$n = $n + 12; 
echo $n++; 
?>
  • (A) 15
  • (B) 12
  • (C) Error
  • (D) 27

A

Admin • 831.35K Points
Coach

Q. PHP is an acronym for ____.

  • (A) Prefix Hypertext Preprocessor
  • (B) Prototype Hypertext Preprocessor
  • (C) Hypertext Preprocessor
  • (D) PHP: Hypertext Preprocessor

A

Admin • 831.35K Points
Coach

Q. Which is/are statement(s) true about PHP?

  • (A) It is an open-source scripting language
  • (B) PHP scripts execute on the server
  • (C) It is used for developing dynamic & interactive websites
  • (D) All of the above

A

Admin • 831.35K Points
Coach

Q. What is the extension of a PHP file?

  • (A) .php
  • (B) .ph
  • (C) .phpfile
  • (D) All of the above

A

Admin • 831.35K Points
Coach

Q. Who developed PHP?

  • (A) Guido van Rossum
  • (B) Rasmus Lerdorf
  • (C) Jesse James Garrett
  • (D) Douglas Crockford

A

Admin • 831.35K Points
Coach

Q. In which year PHP was developed?

  • (A) 1993
  • (B) 1994
  • (C) 1995
  • (D) 1996

A

Admin • 831.35K Points
Coach

Q. A PHP script starts with ____ and ends with ___.

  • (A) <?php and ?>
  • (B) <php> and </php>
  • (C) <?php and /?php>
  • (D) </php and />

A

Admin • 831.35K Points
Coach

Q. Single line comments can be placed in PHP script by using which symbol?

  • (A) //
  • (B) #
  • (C) $
  • (D) Both A and B

A

Admin • 831.35K Points
Coach

Q. PHP statements end with a ______.

  • (A) semicolon (;)
  • (B) colon (:)
  • (C) dot (.)
  • (D) comma (,)

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ