PHP Multiple Choice Questions

  1. In PHP 5, how can you write a class so that some of its properties cannot be accessed from outside its methods?
    1. By declaring the class as private
    2. By declaring the property as private
    3. It cannot be done
    4. By writing a property overloading method
Answer :
B
Explanation:
Added By : Amit


  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

Post Your Question
Social Sharing
Search