Simplified guide of MCQs for Exams, Interviews

Sub Topic: PHP

1 .  What does PHP stand for?

  • A. Hypertext Preprocessor.
  • B. Pretext Hypertext Processor
  • C. Preprocessor Home Page

Correct Answer:

Hypertext Preprocessor.


2 .  PHP files have a default file extension of

  • A. html
  • B. php
  • C. js
  • D. asp

Correct Answer:

php


3 .  A PHP script should start with ___ and end with ___

  • A. < php >
  • B. < ? php ?>
  • C. <? ?>php
  • D. < ?php ? >

Correct Answer:

< ?php ? >


4 .  Which of the following is a PHP code editor?

  • A. Notepad
  • B. Notepad++
  • C. Adobe Dreamweaver
  • D. Sublime Text
  • E. All
  • F. None

Correct Answer:

All


5 .  Which of the following must be installed on your computer so as to run PHP script?

  • A. Adobe Dreamweaver
  • B. Apache
  • C. Sublime

Correct Answer:

Apache


6 .  Which version of PHP introduced Try/catch Exception?

  • A. PHP 4
  • B. PHP 5
  • C. PHP 5.3
  • D. PHP 6

Correct Answer:

PHP 5


7 .  What will be the output of the following php code? <br> $num = 1;<br> $num1 = 2;<br> print $num . "+". $num1; <br>

  • A. 3
  • B. 4
  • C. 1+2
  • D. $num . "+". $num1;

Correct Answer:

1+2


8 .  Which of the below statements is equivalent to $add += $add ?

  • A. $add = $add
  • B. $add = $add +$add
  • C. $add = $add + 1
  • D. $add = $add + $add + 1

Correct Answer:

$add = $add +$add


9 .  Which one of the following is the very first task executed by a session enabled page in PHP?

  • A. Delete the previous session
  • B. Start a new session
  • C. Check whether a valid session exists
  • D. Handle the session

Correct Answer:

Check whether a valid session exists


10 .  How many ways can a session data be stored in PHP?

  • A. 3
  • B. 4
  • C. 5
  • D. 6

Correct Answer:

4