Explore topic-wise MCQs in Technical MCQs.

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

1.

Which data type in PHP offers special variables that hold the references of resources that are external to PHP?

A. Array
B. Resources
C. object
D. string
E.
Answer» C. object
2.

Ord ( ) function is used convert a ______.

A. Integer type into a string
B. Integer type into an array
C. Float type into an array
D. Array type into a string
Answer» B. Integer type into an array
3.

Constants, like variables, can hold _________.

A. integer
B. string
C. Both A and B
D. None of the above
Answer» D. None of the above
4.

What is gettype() function do?

A. gettype() function returns the type of the variable
B. gettype() function is used to set type to variable
C. gettype() function is used to change type to variable
D. None of the above
Answer» B. gettype() function is used to set type to variable
5.

<phpPCmodel="DellInspirion3542";settype(&dollar;PCmodel,"integer");echo &dollar;PCmodel;?>
16.Select the true statements. Once a constant is defined:

A. The value cannot be changed, but the variable can be unset
B. Neither the value can be changed nor variable can be unset
C. The value can be changed, but it cannot be unset
D. The value can be changed and variable can be unset
Answer» C. The value can be changed, but it cannot be unset
6.

<php&dollar;tax="17.5"&dollar;Fridge=Whirlpool;settype(&dollar;Fridge,"string");&dollar;Cost=&dollar;tax+&dollar;Fridge;echo gettype(&dollar;Cost);?>
15.What will be the output of the following code?

A. 0
B. 3542
C. DellInspirion3542
D. Error
Answer» B. 3542
7.

<phpdefine('t',10.3);&dollar;tax=t;echo "t+&dollar;tax";?>
14. What is the data type of $Cost?

A. String
B. Integer
C. Null
D. Float
Answer» C. Null
8.

<php&dollar;TV;echo gettype(&dollar;TV);?>
13.What will be the output of the following code?

A. 20.6
B. 10.3+10.3
C. t+10.3
D. t+&dollar;tax
Answer» D. t+&dollar;tax
9.

<php&dollar;tax=10.3;&dollar;TV="10.3+$TV"; # Line 1?>
12.What is the data type of $TV in the above code?

A. Integer
B. String
C. Unknown
D. Null
Answer» E.
10.

What is the data type of $TV in this Line 1?

A. Integer
B. String
C. Unknown
D. No Output
Answer» C. Unknown