PHP Language | 10 Minute‐Test 22


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 $_POST 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 B

Explanation:

The POST method, data is invisible to others.

2.

Which function is used to verify whether a variable contains a value?

A.
header()
B.
footer()
C.
inset()
D.
isset()

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

The isset() function determines whether a variable has been assigned a value. Its prototype follows: boolean isset(mixed var [,mixed var [,…]])

3.

Since which version of PHP was the directive max_file_limit available.

A.
PHP 5.2.1
B.
PHP 5.2.2
C.
PHP 5.2.12
D.
PHP 5.2.21

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

The max_file_limit directive sets an upper limit on the number of files which can be simultaneously uploaded.

4.

Which one of the following function is used to retrieve the MX records for the domain specified by hostname?

A.
getmx()
B.
retrieve_mx()
C.
getmxrr()
D.
retrieve_mxrr()

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

None

5.

Which one of the following is the default PHP session name?

A.
PHPSESSID
B.
PHPSESID
C.
PHPSESSIONID
D.
PHPIDSESS

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

You can change this name by using the session.name directive.

6.

What will be the output of the following PHP code? Say your previous session username was nachi.

    unset($_SESSION['username']);

    printf("Username now set to: %s", $_SESSION['username']);

A.
Username now set to: nachi
B.
Username now set to: System
C.
Username now set to:
D.
Error

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

To delete the session variable ‘username’ we use the unset() function.

7.

The memory_limit is only applicable if ___ is enabled when you configure PHP. Fill in the blank.

A.
–enable-limit
B.
-enable-memory-limit
C.
–enable-memory-limit
D.
-memory-limit

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

This directive specifies, in megabytes, how much memory a script can use. Default value: 128M.

8.

What will be the output of the following PHP code?

    <?php

    $name = "What is your name?"

    if (preg_match("/name/"),$name)

    echo "My name is Will Pitt ";

    else

    echo "My name is not Will Pitt ";

    if (preg_match("/are/"))

    echo "I am great"

    else

    echo "I am not great";

    ?>

A.
My name is Will Pitt I am great
B.
My name is not Will Pitt I am great
C.
My name is Will Pitt I am not great
D.
My name is not Will Pitt I am not great

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

The code uses preg_match to check for a keyword and replies based on whether it is true (1) or false (0).

9.

In which version of PHP was MySQL Native Driver(also known as mysqlnd) introduced?

A.
PHP 5.0
B.
PHP 5.1
C.
PHP 5.2
D.
PHP 5.3

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

PHP required that MySQL client library be installed on the server from which PHP was communicating with MySQL, whether the MySQL server also happened to reside locally or elsewhere. PHP 5.3 removes this problem by introducing MySQL Native Driver.

10.

Which of the methods are used to manage result sets using both associative and indexed arrays?

A.
get_array() and get_row()
B.
get_array() and get_column()
C.
fetch_array() and fetch_row()
D.
fetch_array() and fetch_column()
Submit your test now to view the Results and Statistics with answer explanation.