PHP Language | 10 Minute‐Test 21


Instruction

  • Total number of questions : 10.
  • Time alloted : 10 minutes.
  • Each question carry 1 mark.
  • No Negative marks
  • DO NOT refresh the page.
  • All the best :-).

1.

When you use the $_GET variable to collect data, the data is visible to..

A.
none
B.
only you
C.
everyone
D.
selected few

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

None

2.

Which of the following PHP function is commonly used when handling authentication via PHP?
i) header()
ii) footer()
iii) inset()
iv) isset()

A.
i) and iv)
B.
ii) and iv)
C.
ii) and iii)
D.
i) and iii)

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

None

3.

What is the default value of max_input_time directive?

A.
30 seconds
B.
60 seconds
C.
120 seconds
D.
1 second

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

None

4.

Which one of the following function is used to return an array consisting of various DNS resource records pertinent to a specific domain?

A.
dns_get_record()
B.
dns_record()
C.
dnsrr_get_record()
D.
dnsrr_record()

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

None

5.

Which directive determines how the session information will be stored?

A.
save_data
B.
session.save
C.
session.save_data
D.
session.save_handler

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

Its prototype follows: session.save_handler = files|mm|sqlite|user.

6.

Which one of the following statements should you use to set the session username to Nachi?

A.
$SESSION[‘username’] = “Nachi”;
B.
$_SESSION[‘username’] = “Nachi”;
C.
session_start(“nachi”);
D.
$SESSION_START[“username”] = “Nachi”;

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

You need to refer the session variable ‘username’ in the context of the $_SESSION superglobal.

7.

What is the default value of max_execution_time directive? This directive specifies how many seconds a script can execute before being terminated.

A.
10
B.
20
C.
30
D.
40

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

This can be useful to prevent users’ scripts from consuming too much CPU time. If max_execution_time is set to 0, no time limit will be set.

8.

Which one of the following functions is used to search a string?

A.
preg_match
B.
preg_search
C.
preg_find
D.
preg_found

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

The function returns 1 if search was successful else returns 0.

9.

Which one of the following lines need to be uncommented or added in the php.ini file so as to enable mysqli extension?

A.
extension=php_mysqli.dll
B.
extension=mysql.dll
C.
extension=php_mysqli.dl
D.
extension=mysqli.dl

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

Also make sure that extension_dir directive points to the appropriate directory.

10.

Which one of the following methods recuperates any memory consumed by a result set?

A.
destroy()
B.
remover()
C.
alloc()
D.
free()
Submit your test now to view the Results and Statistics with answer explanation.