PHP MCQ Questions And Answers

You can practice these PHP MCQs here and if you want a pdf of PHP MCQ Questions And Answers, we will provide a downloading link here soon so please keep visiting here for further modifications.

1. PHP stands for :

  1. Pretext Hypertext Preprocessor
  2. Hypertext Preprocessor
  3. Personal Home Processor
  4. None of the mentioned

Answer : B
Explanation: PHP stands for Hypertext Preprocessor. PHP is an open-source, interpreted, and object-oriented scripting language that is widely used as a server scripting language geared towards web development.

2. PHP is a __________ language?

  1. Server-side scripting
  2. User-side scripting
  3. Client-side scripting
  4. Both A & C

Answer : A
Explanation: PHP (Hypertext Preprocessor) is a server-side scripting language designed specifically for web development.

JavaScript MCQ Questions And Answers

3. Who is known as the father of PHP?

  1. Willam Makepiece
  2. Drek Kolkevi
  3. Rasmus Lerdorf
  4. None of the above

Answer : C
Explanation: PHP (Hypertext Preprocessor) was originally created by Rasmus Lerdorf in 1994 and that’s why he is known as the father of PHP.

4. What is PHP?

  1. PHP is used to develop dynamic and interactive websites
  2. PHP is an open-source programming language
  3. PHP is a server-side scripting language
  4. All of the above

Answer : D
Explanation: Hypertext Preprocessor (PHP) is an open-source server-side scripting language that is used to build dynamic and interactive web pages or web applications and designed specifically for web development.

5. Which version of PHP introduced try/catch Exception?

  1. PHP 5.3
  2. PHP 5
  3. PHP 4
  4. PHP 6

Answer : B
Explanation: PHP version 5 introduced support for exception handling.

6. Which of the following magic constant of PHP returns the full path and filename of the file?

  1. _LINE_
  2. _FUNCTION_
  3. _CLASS_
  4. _FILE_

Answer : D
Explanation: _FILE_ returns the full path and filename of the file. If used inside an include, the name of the included file is returned. Since PHP (Hypertext Preprocessor) 4.0.2, “_FILE_” always contains an absolute path whereas in older versions of PHP, it contained relative path under some circumstances.

7. Which sign is used to access a variable of variable in PHP?

  1. $
  2. $$
  3. #@
  4. $|

Answer : B
Explanation: $$ sign is used to access variable of variable in PHP.

8. Which of the following is true about the php.ini file?

  1. The php.ini file is read each time PHP is initialized
  2. The PHP configuration file, php.ini, is the final and most immediate way to affect PHP’s functionality
  3. Both of the above
  4. None of the above

Answer : C
Explanation: Both of the above option is correct.

Advance Java MCQ Questions And Answers

9. PHP files have a default file extension of ________

  1. .xml
  2. .ph
  3. .php
  4. .html

Answer : C
Explanation: PHP files have a default file extension of .php. So, option C is correct.

10. Which of the following is used for concatenation in PHP?

  1. *
  2. append()
  3. +
  4. .

Answer : D
Explanation: In PHP, the . (dot) operator is used for concatenation. Suppose there are two variables $x and $y, so the statement $x.$y will concatenate both $x and $y.

This Post Has One Comment

Leave a Reply