PHP Language | 10 Minute‐Test 19


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.

Which two predefined variables are used to retrieve information from forms?

A.
$GET & $SET
B.
$_GET & $_SET
C.
$__GET & $__SET
D.
GET & SET

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

None

2.

How many predefined variables does PHP use to authenticate a user?

A.
1
B.
2
C.
3
D.
4

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

None

3.

Which directive determines whether PHP scripts on the server can accept file uploads?

A.
file_uploads
B.
file_upload
C.
file_input
D.
file_intake

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

By default its value is on.

4.

What is the full form of DNS?

A.
Digital Network System
B.
Domain Network System
C.
Digital Name System
D.
Domain Name System

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

The Domain Name System(DNS) is what allows you to use domain names(e.g., example.com) in place of the corresponding IP address, such as 192.0.10.10.

5.

Which one of the following is the very first task executed by a session enabled page?

A.
Delete the previous session
B.
Start a new session
C.
Check whether a valid session exists
D.
Handle the session

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

None

6.

Which function is used to erase all session variables stored in the current session?

A.
session_destroy()
B.
session_change()
C.
session_remove()
D.
session_unset()

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

This will not completely remove the session from the storage mechanism. If you want to completely destroy the session, you need to use the function session_destroy().

7.

Which one of the following statements should be used to disable just the fopen(), and file() functions?

A.
disable_functions = fopen(),file()
B.
disable_functions = fopen,file
C.
functions_disable = fopen(),file()
D.
functions_disable = fopen,file

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

You can set disable_functions equal to a comma-delimited list of function names that you want to disable.

8.

What will be the output of the following PHP code?

    <?php

    $number = array(0,1,two,three,four,5);

    $num = preg_grep("/[0-5]/", $number);

    print_r($num);

    ?>

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 [1]=>1 [5]=>5)

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

The preg_grep function is used to search an array for specific patterns and then return a new array based on that filtering.

9.

Which one of the following databases has PHP supported almost since the beginning?

A.
Oracle Database
B.
SQL
C.
SQL+
D.
MySQL

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

None

10.

Which one of the following statements should be used to include a file?

A.
#include ‘filename’;
B.
include ‘filename’;
C.
@include ‘filename’;
D.
#include ;
Submit your test now to view the Results and Statistics with answer explanation.