93
79.2k

320+ Advance PHP Solved MCQs

These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Bachelor of Business Administration in Computer Applications (BBA [CA]) , Master of Science in Software Engineering (MSc SE) .

Chapters

Chapter: OOP
51.

class needs to inherit multiple behaviors? OOP------is used to solve this problem. Sol:

A. static
B. self
C. traits
D. single inheritance
Answer» C. traits
52.

------are used to declare methods that can be used in multiple classes. Traits can have methods and abstract methods that can be used in multiple classes.

A. static
B. self
C. traits
D. single inheritance
Answer» C. traits
53.

Traits are declared with the----keyword Sol:

A. static
B. self
C. traits
D. single inheritance
Answer» C. traits
54.

------methods can be called directly - without creating an instance of the class first. Sol:

A. static
B. self
C. traits
D. single inheritance
Answer» A. static
55.

Static methods are declared with the------keyword Sol:

A. static
B. self
C. traits
D. single inheritance
Answer» A. static
56.

A class can have both static and non-static methods. A static method can be accessed from a method in the same class using the-----keyword and double colon (::)

A. static
B. self
C. traits
D. single inheritance
Answer» B. self
57.

------properties can be called directly - without creating an instance of a class. Sol:

A. static
B. self
C. traits
D. single inheritance
Answer» A. static
58.

An iterable is any value which can be looped through with a-----loop. Sol:

A. foeach()
B. self
C. traits
D. single inheritance
Answer» A. foeach()
59.

The-----pseudo-type was introduced in PHP 7.1, and it can be used as a data type for function arguments and function return values.

A. foeach()
B. self
C. iterable
D. single inheritance
Answer» C. iterable
60.

The-----keyword can be used as a data type of a function argument or as the return type of a function:

A. foeach()
B. self
C. iterable
D. single inheritance
Answer» C. iterable
Chapter: Unit 2
61.

------is a superglobal that holds information regarding HTTP headers, path and script location etc.

A. $_SERVER
B. SERVER_ADDR
C. SERVER_NAME
D. QUERY_STRING
Answer» A. $_SERVER
62.

All the server and execution environment related information is available in this------ Sol:

A. associative array
B. SERVER_ADDR
C. SERVER_NAME
D. QUERY_STRING
Answer» A. associative array
63.

-------This property of array returns The IP address of the server under which the current script is executing.

A. $_SERVER
B. SERVER_ADDR
C. SERVER_NAME
D. QUERY_STRING
Answer» B. SERVER_ADDR
64.

-------Name of server hostunder which the current script is executing Sol:

A. $_SERVER
B. SERVER_ADDR
C. SERVER_NAME
D. QUERY_STRING
Answer» C. SERVER_NAME
65.

-------A query string is the string of key=value pairs separated by & symbol and appended to URL after ? symbol. For example, http://localhost/testscript?name=xyz&age=20 URL returns trailing query string.

A. $_SERVER
B. SERVER_ADDR
C. SERVER_NAME
D. QUERY_STRING
Answer» D. QUERY_STRING
66.

--------HTTP request method used for accessing a URL, such as POST, GET, POST, PUT or DELETE.

A. REQUEST_METHOD
B. DOCUMENT_ROOT
C. REMOTE_ADDR
D. SERVER_PORT
Answer» A. REQUEST_METHOD
67.

-----------returns name of directory on server that is configured as document root Sol:

A. REQUEST_METHOD
B. DOCUMENT_ROOT
C. REMOTE_ADDR
D. SERVER_PORT
Answer» B. DOCUMENT_ROOT
68.

------------IP address of machine from which the user is viewing the current page Sol:

A. REQUEST_METHOD
B. DOCUMENT_ROOT
C. REMOTE_ADDR
D. SERVER_PORT
Answer» C. REMOTE_ADDR
69.

-------port number on which the web server is listening to incoming request Sol:

A. REQUEST_METHOD
B. DOCUMENT_ROOT
C. REMOTE_ADDR
D. SERVER_PORT
Answer» D. SERVER_PORT
70.

there are two ways the browser client can send information to the web server . The -------------Method & The---------- Method

A. info and pre method
B. Get and post method
C. implement and extend method
D. none of these.
Answer» A. info and pre method
71.

Before the browser sends the information to the server , it encodes it using a scheme called URL.

A. yes
B. no
C. can not say
D. none of these.
Answer» A. yes
72.

After the information is encoded it is sent to the server Spaces are removed and replaced with the + character and any other non alphanumeric characters are replaced with a hexadecimal values.

A. yes
B. no
C. can not say
D. none of these.
Answer» A. yes
73.

The-----method sends the encoded user information appended to the page request. The page and the encoded information are separated by the ? character

A. GET
B. ?
C. POST
D. QUERY_STRING
Answer» B. ?
74.

The-----method produces a long string that appears in your server logs, in the browser's Location

A. GET
B. ?
C. POST
D. QUERY_STRING
Answer» A. GET
75.

The-----method is restricted to send upto 1024 characters only Sol:

A. GET
B. ?
C. POST
D. QUERY_STRING
Answer» A. GET
76.

Never use-----method if you have password or other sensitive information to be sent to the server.

A. GET
B. ?
C. POST
D. QUERY_STRING
Answer» A. GET
77.

------can't be used to send binary data, like images or word documents, to the server Sol:

A. GET
B. ?
C. POST
D. QUERY_STRING
Answer» A. GET
78.

The data sent by GET method can be accessed using-------environment variable. Sol:

A. GET
B. ?
C. POST
D. QUERY_STRING
Answer» D. QUERY_STRING
79.

The PHP provides-------associative array to access all the sent information using GET method.

A. $_GET
B. $_POST
C. POST
D. QUERY_STRING
Answer» A. $_GET
80.

PHP------is a PHP super global variable which is used to collect form data after submitting an HTML form with method="get".

A. $_GET
B. $_POST
C. POST
D. QUERY_STRING
Answer» A. $_GET
81.

The-----method transfers information via HTTP headers. Sol:

A. $_GET
B. $_POST
C. POST
D. QUERY_STRING
Answer» C. POST
82.

The information is encoded as described in case of GET method and put into a header called-----------.

A. $_GET
B. $_POST
C. POST
D. QUERY_STRING
Answer» D. QUERY_STRING
83.

The----------method does not have any restriction on data size to be sent. Sol:

A. $_GET
B. $_POST
C. POST
D. QUERY_STRING
Answer» C. POST
84.

The-----------method can be used to send ASCII as well as binary data Sol:

A. $_GET
B. $_POST
C. POST
D. QUERY_STRING
Answer» C. POST
85.

The PHP provides----------associative array to access all the sent information using POST method.

A. $_GET
B. $_POST
C. POST
D. QUERY_STRING
Answer» B. $_POST
86.

PHP--------is a PHP super global variable which is used to collect form data after submitting an HTML form with method="post". $_POST is also widely used to pass variables

A. $_GET
B. $_POST
C. POST
D. QUERY_STRING
Answer» B. $_POST
87.

The-----method can retrieve information identified by the request-URl (Uniform
Resource Identifier)
Sol:

A. $_GET
B. $_POST
C. POST
D. GET
Answer» D. GET
88.

Use-----when you need the server, which controls URL generation of your resources Sol:

A. $_GET
B. $_POST
C. POST
D. GET
Answer» C. POST
89.

------is a secure method as its requests do not remain in browser history. Sol:

A. $_GET
B. $_POST
C. POST
D. GET
Answer» C. POST
90.

By the used of-------method You can keep the data private. Sol:

A. $_GET
B. $_POST
C. POST
D. GET
Answer» C. POST
91.

--------can't be used to send word documents or images. Sol:

A. $_GET
B. $_POST
C. POST
D. GET
Answer» D. GET
92.

----------requests can be used only to retrieve data Sol:

A. $_GET
B. $_POST
C. POST
D. GET
Answer» D. GET
93.

The----------method cannot be used for passing sensitive information like usernames and passwords.

A. $_GET
B. $_POST
C. POST
D. GET
Answer» D. GET
94.

If you use------method, the browser appends the data to the URL Sol:

A. $_GET
B. $_POST
C. POST
D. GET
Answer» D. GET
95.

You cannot see------requests in browser history while You can see GET requests in browser history

A. $_GET
B. $_POST
C. POST
D. GET
Answer» C. POST
96.

This------method is not compatible with some firewall setups. Sol:

A. $_GET
B. $_POST
C. POST
D. GET
Answer» C. POST
97.

In-------method, values are visible in the URL while in POST method, values are NOT visible in the URL.

A. $_GET
B. $_POST
C. POST
D. GET
Answer» D. GET
98.

------has a limitation on the length of the values, generally 255 characters Sol:

A. $_GET
B. $_POST
C. POST
D. GET
Answer» D. GET
99.

-------has no limitation on the length of the values since they are submitted via the body of HTTP.

A. $_GET
B. $_POST
C. POST
D. GET
Answer» C. POST
100.

GET method supports only string data types while-----method supports different data types, such as string, numeric, binary, etc

A. $_GET
B. $_POST
C. POST
D. GET
Answer» C. POST

Done Studing? Take A Test.

Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.