Explore topic-wise MCQs in Php.

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

51.

PHP automatically assigns variables to next page when you submit data using

A. Get method
B. Post method
C. Parsing method
D. Both a and b
Answer» E.
52.

Get, Post, Cookies and Sessions all are examples of

A. Arrays
B. Functions
C. Methods to pass information
D. None of them
Answer» D. None of them
53.

This statement /* My PHP File */ is an example of

A. Single line comment
B. Multiline comments
C. Variable declaration
D. None of them
Answer» C. Variable declaration
54.

Errors that are caused by mistyped or syntactically incorrect PHP code, is called as

A. Rendering problem
B. Installation related problem
C. Parsing errors
D. All of them
Answer» D. All of them
55.

HTTP protocol is stateless because a plain HTML page is not capable of

A. Receiving information from other pages
B. Supporting php
C. Supporting web services
D. All of them
Answer» B. Supporting php
56.

NAN problem is a

A. Mathematical problem
B. Parsing error
C. Rendering error
D. None of them
Answer» B. Parsing error
57.

If I already had a Debug class in the main namespace. What will be the output of the following code?

A. error
B. hello from main
C. hello from main\Debug
D. debug
Answer» B. hello from main
58.

How many different ways are offered by PHP to manipulate a data type?

A. 2
B. 3
C. 4
D. 5
Answer» C. 4
59.

Which one is not a data type in PHP?

A. Resources
B. Objects
C. Null
D. Void
Answer» E.
60.

Floatval ( ) function will convert your argument in

A. Integer
B. String
C. Float
D. None of them
Answer» D. None of them
61.

Which of following type conversion behavior is offered by PHP?

A. Array to boolean
B. Null to number
C. Resource to string
D. All of them
Answer» E.
62.

How many basic data types are offered by PHP?

A. 5
B. 6
C. 7
D. 8
Answer» E.
63.

How resources are created in PHP?

A. They are created by themselves
B. They call special functions that return values of the resource type
C. They are defined in a script
D. None of them
Answer» C. They are defined in a script
64.

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
65.

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

A. Arrays
B. Objects
C. Resources
D. Strings
Answer» D. Strings
66.

Which data type is not valid in PHP for type casting?

A. Null
B. Resource
C. Float
D. Both a and b
Answer» E.
67.

For checking a data type, PHP offers a function called

A. type ( )
B. get_arg ( )
C. gettype ( )
D. get_t ( )
Answer» D. get_t ( )
68.

WHICH_CLASS_ACCEPTS_A_CLASS_NAME_OR_AN_OBJECT_REFERENCE_AND_RETURNS_AN_ARRAY_OF_INTERFACE_NAME??$

A. class_implements()
B. is_subclass()
C. is_subclass_of()
D. class_interface()
Answer» B. is_subclass()
69.

If you call a method and it doesn’t exist it’ll cause a problem. To check the method which function will you use?$

A. _method()
B. methodexists()
C. is_callable()
D. is_method()
Answer» D. is_method()