PHP Multiple Choice Questions

  1. The ___________ function automatically transforms newline characters into HTML <br /> tags.
    1. br2nl
    2. nl2br
    3. nlbr
    4. None of the above
Answer :
B
Explanation:
Added By : Amit

  1. By default, PHP stores session data in ______________.
    1. The filesystem
    2. A database
    3. Virtual memory
    4. Shared memory
Answer :
A
Explanation:
Added By : Amit


  1. How are session variables accessed through?
    1. $_GET
    2. $_POST
    3. $_REQUEST
    4. None of the above
Answer :
D
Explanation:
Added By : Amit

  1. If cookie expiration time is not set explicitly, what happens to it?
    1. It expires right away
    2. It never expires
    3. It is not set
    4. It expires at the end of the user's browser session
Answer :
D
Explanation:
Added By : Amit

  1. PECL stands for?
    1. PHP Extension Community Laboratory
    2. PHP Extension Combined Library
    3. PHP Export Community Library
    4. PHP Extension Community Library
Answer :
D
Explanation:
Added By : Satyam

  1. PEAR stands for?
    1. PHP Extension and Application Record
    2. PHP Extended and Application Repository
    3. PHP Extension and Application Repository
    4. PHP Extension and Applicable Repository
Answer :
C
Explanation:
Added By : Satyam


  1. How does the identity operator === compare two values?
    1. It converts both to a common compatible data type and then compares the values
    2. It returns True only if they are both of the same type and value
    3. It converts both values to strings and compares them
    4. If the two values are strings, it performs a syntax comparison
Answer :
B
Explanation:
Added By : Manish Kumar

  1. In which circumstance it is not possible to assign default value to a parameter while declaring a function?
    1. When the parameter is Boolean
    2. When the function is being declared as a member of a class
    3. When the parameter is being declared as passed by reference
    4. When the function contains only one parameter
Answer :
C
Explanation:

We cannot specify default value for parameter declared as passed by reference.

Added By : Manish Kumar

Social Sharing
Search