PHP Language | 10 Minute‐Test 20


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.

The attack which involves the insertion of malicious code into a page frequented by other users is known as..

A.
basic sql injection
B.
advanced sql injection
C.
cross-site scripting
D.
scripting

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

None

2.

Which of the following variables does PHP use to authenticate a user?
i) $_SERVER[‘PHP_AUTH_USER’]
ii) $_SERVER[‘PHP_AUTH_USERS’]
iii) $_SERVER[‘PHP_AUTH_PU’]
iv) $_SERVER[‘PHP_AUTH_PW’]

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

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

$_SERVER[‘PHP_AUTH_USER’] and $_SERVER[‘PHP_AUTH_PW’] store the username and password values, respectively.

3.

Which of the following directive determines the maximum amount of time that a PHP script will spend attempting to parse input before registering a fatal error?

A.
max_take_time
B.
max_intake_time
C.
max_input_time
D.
max_parse_time

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

This is relevant because particularly large files can take some time to upload, eclipsing the time set by this directive.

4.

Which one of the following function checks for the existence of DNS records?

A.
checkdns()
B.
checkdnsr()
C.
checkdnsrr()
D.
checkdnsa()

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

DNS records are checked based on the supplied host value and optional DNS resource record type, returning TRUE if any records are located and FALSE otherwise.

5.

How many ways can a session data be stored?

A.
3
B.
4
C.
5
D.
6

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

Within flat files(files), within volatile memory(mm), using the SQLite database(sqlite), or through user defined functions(user).

6.

What will the function session_id() return is no parameter is passed?

A.
Current Session Identification Number
B.
Previous Session Identification Number
C.
Last Session Identification Number
D.
Error

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

None

7.

Which one of the following statements should be used to disable the use of two classes administrator and janitor?

A.
disable_classes = “administrator, janitor”
B.
disable_classes = class administrator, class janitor
C.
disable_classes = class “administrator”, class “janitor”
D.
disable_class = class “administrator”, class “janitor”

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

There may be classes inside the libraries that you’d rather not make available. You can prevent the use of these classes with the disable_classes directive.

8.

What will be the output if we replace the line $num = preg_grep(“/[0-5]/”, $number); with $num = preg_grep(“/[0-5]/”, $number, PREG_GREP_INVERT);?

A.
Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5)
B.
Array([2]=>two [3]=>three [4]=>four)
C.
Array([1]=> 1)
D.
Array([0]=>0 [5]=>5)

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

When we include PREG_GREP_INVERT, this will invert our data, so instead of outputting numbers it will output our non-numeric values.

9.

The updated MySQL extension released with PHP 5 is typically referred to as..

A.
MySQL
B.
mysql
C.
mysqli
D.
mysqly

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

The updated MySQL extension with PHP 5 is known as MySQL and typically referred to as mysqli.

10.

Which one of the following methods is responsible for sending the query to the database?

A.
query()
B.
send_query()
C.
sendquery()
D.
query_send()
Submit your test now to view the Results and Statistics with answer explanation.