Top 350+ Solved Advance PHP MCQ Questions Answer
Q. A class can have both static and non-static methods. A static method can be accessedfrom a method in the same class using the-----keyword and double colon (::)Sol:
a. static
b. self
c. traits
d. single inheritance
Q. ------properties can be called directly - without creating an instance of a class.Sol:
a. static
b. self
c. traits
d. single inheritance
Q. An iterable is any value which can be looped through with a-----loop.Sol:
a. foeach()
b. self
c. traits
d. single inheritance
Q. The-----pseudo-type was introduced in PHP 7.1, and it can be used as a data type forfunction arguments and function return values.Sol:
a. foeach()
b. self
c. iterable
d. single inheritance
Q. The-----keyword can be used as a data type of a function argument or as the return typeof a function:Sol:
a. foeach()
b. self
c. iterable
d. single inheritance
Q. ------is a superglobal that holds information regarding HTTP headers, path and scriptlocation etc.Sol:
a. $_SERVER
b. SERVER_ADDR
c. SERVER_NAME
d. QUERY_STRING
Q. 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
Q. -------This property of array returns The IP address of the server under which the currentscript is executing.Sol:
a. $_SERVER
b. SERVER_ADDR
c. SERVER_NAME
d. QUERY_STRING
Q. -------Name of server hostunder which the current script is executingSol:
a. $_SERVER
b. SERVER_ADDR
c. SERVER_NAME
d. QUERY_STRING
Q. -------A query string is the string of key=value pairs separated by & symbol andappended to URL after ? symbol. For example, http://localhost/testscript?name=xyz&age=20 URL returns trailing query string.Sol:
a. $_SERVER
b. SERVER_ADDR
c. SERVER_NAME
d. QUERY_STRING
Q. --------HTTP request method used for accessing a URL, such as POST, GET, POST,PUT or DELETE.Sol:
a. REQUEST_METHOD
b. DOCUMENT_ROOT
c. REMOTE_ADDR
d. SERVER_PORT
Q. -----------returns name of directory on server that is configured as document rootSol:
a. REQUEST_METHOD
b. DOCUMENT_ROOT
c. REMOTE_ADDR
d. SERVER_PORT
Q. ------------IP address of machine from which the user is viewing the current pageSol:
a. REQUEST_METHOD
b. DOCUMENT_ROOT
c. REMOTE_ADDR
d. SERVER_PORT
Q. -------port number on which the web server is listening to incoming requestSol:
a. REQUEST_METHOD
b. DOCUMENT_ROOT
c. REMOTE_ADDR
d. SERVER_PORT
Q. there are two ways the browser client can send information to the web server .The -------------Method & The---------- MethodSol:
a. info and pre method
b. Get and post method
c. implement and extend method
d. none of these.