Q. What does PHP stand for?
1. Personal Home Page
2. Hypertext Preprocessor
3. Pretext Hypertext Processor
4. Preprocessor Home Page

  • (A) Both 1 and 3
  • (B) Both 2 and 4
  • (C) Only 2
  • (D) Both 1 and 2
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both 1 and 2
Explanation: PHP stands for Personal Home page and Preprocessor Home Page so option D is correct.

Q. PHP files have a default file extension of_______.

  • (A) .html
  • (B) .xml
  • (C) .php
  • (D) .ph
πŸ’¬ Discuss
βœ… Correct Answer: (C) .php

Q. Which of the following is/are a PHP code editor?
1. Notepad
2. Notepad++
3. Adobe Dreamweaver
4. PDT

  • (A) Only 4
  • (B) All of the mentioned
  • (C) 1, 2 and 3
  • (D) Only 3
πŸ’¬ Discuss
βœ… Correct Answer: (B) All of the mentioned

Q. Which of the following must be installed on your computer so as to run PHP script?
1. Adobe Dreamweaver
2. PHP
3. Apache
4. IIS

  • (A) Only 2
  • (B) 2 and 3
  • (C) 2, 3 and 4
  • (D) All of the mentioned.
πŸ’¬ Discuss
βœ… Correct Answer: (C) 2, 3 and 4

Q. Which version of PHP introduced Try/catch Exception?

  • (A) PHP 4
  • (B) PHP 5
  • (C) PHP 5.3
  • (D) PHP 6
πŸ’¬ Discuss
βœ… Correct Answer: (B) PHP 5

Q. We can use _________ to comment a single line?
1. /?
2. //
3. #
4. /* */

  • (A) Only 2
  • (B) 1, 3 and 4
  • (C) 2, 3 and 4
  • (D) Both 2 and 4
πŸ’¬ Discuss
βœ… Correct Answer: (C) 2, 3 and 4

Q. Which of the following php statement/statements will store 111 in variable num?
1. int $num = 111;
2. int mum = 111;
3. $num = 111;
4. 111 = $num;

  • (A) Both 1 and 2
  • (B) All of the mentioned
  • (C) Only 3
  • (D) Only 1
πŸ’¬ Discuss
βœ… Correct Answer: (C) Only 3

Q. What will be the output of the following php code?

Code:
<?php
$num  = 1;
$num1 = 2;
print $num . "+". $num1;
?>
  • (A) 3
  • (B) 1+2
  • (C) 1.+.2
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 1+2

Q. What will be the output of the following php code?

Code:
<?php
$num  = "1";
$num1 = "2";
print $num+$num1;
?>
  • (A) 3
  • (B) 1+2
  • (C) 12
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) 3

Q. Which of following variables can be assigned a value to it?
1. $3hello
2. $_hello
3. $this
4. $This

  • (A) All of the mentioned
  • (B) Only 2
  • (C) 2, 3 and 4
  • (D) 2 and 4
πŸ’¬ Discuss
βœ… Correct Answer: (D) 2 and 4