Explore topic-wise MCQs in Php.

This section includes 18 Mcqs, each offering curated multiple-choice questions to sharpen your Php knowledge and support exam preparation. Choose a topic below to get started.

1.

What will be the output of the following PHP code ?<?php$Country1 = "INDIA";$Country2 = "INDIA";print($Country1 == $Country2);?>

A. Error
B. Nothing
C. INDIA
D. 0
E. 1
Answer» F.
2.

What will be the output of the following PHP code ?<?php$Color1 = "YELLOW";$Color2 = "GREEN";print($Color1==$Color2);?>

A. error
B. nothing
C. YELLOW
D. GREEN
E. None of these
Answer» C. YELLOW
3.

What will be the output of the following PHP code ?<?phpprint("This"."is"."a"."good"."girl");?>

A. Nothing
B. Error
C. Thisisagoodgirl
D. This.is.a.good.girl
E. None of these
Answer» D. This.is.a.good.girl
4.

What will be the output of the following PHP code ?<?phpprint "echo Interview Mania";?>

A. Interview Mania
B. Error
C. Nothing
D. echo Interview Mania
E. None of these
Answer» E. None of these
5.

What will be the output of the following PHP code ?<?php$First = "Ajit";$Second = "Ats";print($First $Second);?>

A. First
B. Second
C. Ajit
D. Ats
E. Error
Answer» F.
6.

What will be the output of the following PHP code ?<?php$City = array("Chennai", "Mumbai", "Noida");print $City[2];?>

A. Chennai
B. Mumbai
C. Noida
D. Error
E. None of these
Answer» D. Error
7.

What will be the output of the following PHP code ?<?php$num = 5;print($num);print $num;?>

A. 5
B. 0
C. Error
D. Nothing
E. 55
Answer» F.
8.

What will be the output of the following PHP code ?<?phpecho "it","is"|"a","good"."name";?>

A. Nothing
B. itisgoodname
C. it,is|a,good.name
D. Error
E. None of these
Answer» C. it,is|a,good.name
9.

What will be the output of the following PHP code ?<?phpecho "it", "is", "a", "good", "name";?>

A. Error
B. Nothing
C. itisagoodname
D. it, is, a, good, name
E. None of these
Answer» D. it, is, a, good, name
10.

What will be the output of the following PHP code ?<?phpecho "Hello Interview Mania<strong>I am learning PHP</strong>"?>

A. Hello Interview Mania
B. Error
C. Nothing
D. I am learning PHP
E. Hello Interview Mania
Answer» F.
11.

What will be the output of the following PHP code ?<?php$First = "First";$Second = "Second";print($First,$Second);?>

A. Error
B. First
C. Second
D. Nothing
E. None of these
Answer» B. First
12.

What will be the output of the following PHP code ?<?phpecho "it" . "is" . "a" . "good" . "name";?>

A. itisagoodname
B. Error
C. Nothing
D. it.is.a.good.name
E. None of these
Answer» B. Error
13.

What will be the output of the following PHP code ?<?phpecho "This is <i>Interview Mania</i>";?>

A. This is
B. This is
C. Interview Mania
D. Error
E. None of these
Answer» B. This is
14.

What will be the output of the following PHP code ?<?php$First = "Hello ";$Second = "Interview Mania";echo $First, $Second;?>

A. Hello Interview Mania
B. Error
C. Interview Mania
D. Nothing
E. None of these
Answer» B. Error
15.

What will be the output of the following PHP code ?<?php$name = array("Ajit", "Ats", "Aju");echo "My name is {$name[0]}";?>

A. Ajit
B. My name is
C. Error
D. My name is Ajit
E. None of these
Answer» E. None of these
16.

What will be the output of the following PHP code ?<?php$First = "Mania";$Second = "Interview";echo "$First"+"$Second";?>

A. Mania
B. 0
C. Error
D. Interview
E. None of these
Answer» C. Error
17.

What will be the output of the following PHP code ?<?php$First = "Interview ";$Second = "Mania";echo "$First$Second";?>

A. Interview
B. Interview Mania
C. Mania
D. Error
E. None of these
Answer» C. Mania
18.

What will be the output of the following PHP code ?<?php$Color1 = "RED";$Color2 = "YELLOW";print("$Color1$Color2");?>

A. RED
B. YELLOW
C. Error
D. REDYELLOW
E. None of these
Answer» E. None of these