Home

Php Programming MCQ Question with Answer

Php Programming MCQ with detailed explanation for interview, entrance and competitive exams. Explanation are given for understanding.

Download Php Programming MCQ Question Answer PDF

Question No : 1

What does PHP stand for?


i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page


Both i) and iii)


Both ii) and iv)


Only ii)


Both i) and ii)


Question No : 2

PHP files have a default file extension of..


.html


.xml


.php


.ph


.asp


.jsp


Question No : 3

A PHP script should start with ___ and end with ___:


< php >


< ? php ?>


<?php ?>


<% %>


Question No : 4

Which of the following is/are a PHP code editor?
i) Notepad
ii) Notepad++
iii) Adobe Dreamweaver
iv) PDT


Only iv)


All of the mentioned.


i), ii) and iii)


Only iii)


Question No : 5

Which of the following must be installed on your computer so as to run PHP script?
i) Adobe Dreamweaver
ii) PHP
iii) Apache
iv) IIS


All of the mentioned.


Only ii)


ii) and iii)


ii), iii) and iv)


Question No : 6

Which of following variables can be assigned a value to it?
i) $3hello
ii) $_hello
iii) $this
iv) $This


All of the mentioned


Only ii)


ii), iii) and iv)


ii) and iv)


Question No : 7

What will be the output of the following code?



<?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>

Error


My name is BobBob


My name is BobMy name is Bob


My name is Bob Bob