PHP/PHP Basics Mcq Questions Sample Test,Sample questions

Question:
 What will be the output of the following code?
< ?php 
$foo = 'Bob';              
$bar = &$foo;              
$bar = "My name is $bar";  
echo $bar;
echo $foo;
?>

1.Error

2.My name is BobBob

3.My name is BobMy name is Bob

4.My name is Bob Bob


Question:
 Which of the below symbols is a newline character?

1.

2.

3./n

4. /r


Question:
 Which of the following php statement/statements will store 111 in variable num?
i) int $num = 111;
ii) int mum = 111;
iii) $num = 111;
iv) 111 = $num;

1.Both (i) and (ii)

2.All of the mentioned

3. Only (iii)

4.Only (i)


Question:
 Which version of PHP introduced Try/catch Exception?

1. PHP 4

2. PHP 5

3.PHP 5C. PHP 5.3

4. PHP 6


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

1. < php >

2.< ? php ?>

3. < ? ? >

4.< ?php ? >


Question:
PHP files have a default file extension of.

1.htmlB

2.xml

3..php

4. .ph


Question:
We can use ___ to comment a single line?
i) /?
ii) //
iii) #
iv) /* */

1.Only (ii)B.C. D.

2. (i), (iii) and (iv)

3.(ii), (iii) and (iv)

4.Both (ii) and (iv)


Question:
What does PHP stand for?
i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page

1.Both (i) and (ii)

2.Both (ii) and (iv)

3.Only (ii)

4.Both (i) and (iii)


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

1.3

2.1+2

3. 1.+.2

4.Error


Question:
What will be the output of the following php code?
< ?php 
$num  = "1";
$num1 = "2";
print $num+$num1 ;

1.3

2. 1+2

3.Error

4.12


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

1.All of the mentioned

2.Only (ii)

3.(ii), (iii) and (iv)

4.(ii) and (iv)


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

1.Adobe Dreamweaver

2.PHP

3.Apache

4.IIS


Question:
Who is the father of PHP?

1.Rasmus Lerdorf

2.Willam Makepiece

3.Drek Kolkevi

4. List Barely


More MCQS

  1. PHP Mcq Set 1
  2. PHP Mcq Set 2
  3. PHP Mcq Set 3
  4. PHP Mcq Set 4
  5. Current affairs mcq php
  6. Current affairs mcq php set 2
  7. Current affairs mcq php set 3
  8. PHP MCQ
  9. PHP MCQ– Basics
  10. PHP Mcq – Functions
  11. PHP Mcq Arrays
  12. PHP Mcq– Basics of Object-Oriented PHP
  13. PHP Mcq – Error Handling
  14. PHP Basics Mcq Questions
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!