Simplified guide of MCQs for Exams, Interviews

Sub Topic: PHP

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

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

Correct Answer:

PHPSESSID


2 .  If session.use_cookie is set to 0, this results in use of

  • A. Session
  • B. Cookie
  • C. URL rewriting
  • D. Nothing happens

Correct Answer:

URL rewriting


3 .  If the directive session.cookie_lifetime is set to 3600, the cookie will live until

  • A. 3600 sec
  • B. 3600 min
  • C. 3600 hrs

Correct Answer:

3600 sec


4 .  What is the default number of seconds that cached session pages are made available before the new pages are created?

  • A. 360
  • B. 180
  • C. 1800
  • D. 3600

Correct Answer:

180


5 .  The if statement is used to execute some code only if a specified condition is true

  • A. True
  • B. False

Correct Answer:

True


6 .  Which operator is used to check if two values are equal and of same data type?

  • A. ===
  • B. !=
  • C. ==
  • D. =

Correct Answer:

===


7 .  In PHP, the only way to output text is with echo.

  • A. True
  • B. False

Correct Answer:

False


8 .  How do you create a cookie in PHP?

  • A. setcookie()
  • B. makecookie()
  • C. createcookie

Correct Answer:

setcookie()


9 .  The die() and exit() functions do the exact same thing.

  • A. True
  • B. False

Correct Answer:

True


10 .  PHP can be run on Microsoft Windows IIS(Internet Information Server)

  • A. True
  • B. False

Correct Answer:

True