17th
Mar
PHP MCQ

PHP MCQ

  • Admin
  • 17th Mar, 2023
  • 842 Followers

PHP is an abbreviation of PHP: HyperText Preprocessor. It is a server-side scripting language, that is used to develop dynamic web pages. It is developed by Rasmus Lerdorf in 1995. It is the most popular programming language in the world because it is easy to learn.

Finally, Take the Advanced PHP MCQ Test to brush up your PHP programming skills.

PHP MCQ with Answers

1) PHP is a ............

  • A. Open Source Laguage
  • B.Widely Used Language
  • C.Server side scripting language
  • D.All of the above

2) The date_sunset() function returns the sunset time for a specified day and location.

  • A. True
  • B.False

3) Which of the following symbol is used to add multiple line comments in PHP ?

  • A. //
  • B./* */
  • C.{{ }}
  • D.{/ \}

4) PHP is a case sensitive language.

  • A. True
  • B.False

5) Which sign is used to access variable of variable in PHP?

  • A. $$
  • B.$
  • C.#@
  • D.$|
Download Free : PHP MCQ PDF

6) Which of following is not a Superglobals in PHP?

  • A. $_SERVER
  • B.$_ENV
  • C.$_FILES
  • D.$_PUT

7) Which function is used to get ASCII value of a character in PHP ?

  • A. asc()
  • B.chr( )
  • C.ascii()
  • D.val( )

8) ______ is used to unset a variable in PHP ?

  • A. delete()
  • B.unset()
  • C.unlink()
  • D.delete();

9) How many error levels are available in PHP ?

  • A. 20
  • B.4
  • C.19
  • D.16

10) In which version of PHP E_STRICT Error level is introduced ?

  • A. PHP 4
  • B.PHP 5
  • C.PHP 5.2
  • D.PHP 7

11) Which function in PHP is used to get the length of string variable?

  • A. count()
  • B.strcount
  • C.strlen
  • D.len

12) Which of the below symbols is a newline character?

  • A. \n
  • B.\r
  • C./n
  • D./r

13) Who is the father of PHP?

  • A. Drek Kolkevi
  • B.Rasmus Lerdorf
  • C.Willam Makepiece
  • D.List Barely

14) Type Hinting was introduced in which version of PHP?

  • A. PHP 5
  • B.PHP 5.3
  • C.PHP 4
  • D.PHP 6

15) A function in PHP which starts with __ (double underscore) is known as __________ .

  • A. Inbuilt Function
  • B.Default Function
  • C.Magic Function
  • D.User Defined Function

16) Which of the following PHP functions accepts any number of parameters?

  • A. func_get_args()
  • B.func_get_argv()
  • C.get_argv()
  • D.get_argc()

17) PHP’s numerically indexed array begin with position ___________ .

  • A. -1
  • B.0
  • C.1
  • D.2

18) Which of the functions is used to sort an array in descending order?

  • A. asort()
  • B.sort()
  • C.rsort()
  • D.dsort()

19) Which one of the following property scopes is not supported by PHP?

  • A. public
  • B.final
  • C.friendly
  • D.static

20) PHP stands for ..........

  • A. Personal Home Page
  • B.PHP Hypertext Preprocessor
  • C.Pro Hypertext Preprocessor
  • D.None of the above

21) PHP files have a default file extension of .............

  • A. .xml
  • B..html
  • C..php
  • D..py

22) Which of the following is/are a PHP code editor?

  • A. Notepad ++
  • B.VS Code Editor
  • C.Sublime Text
  • D.All of the above

23) How to define a function in PHP?

  • A. function {function body}
  • B.functionName(parameters) {function body}
  • C.function functionName(parameters) {function body}
  • D.None of the above

24) what is the latest version of PHP?

  • A. PHP 3
  • B.PHP 5
  • C.PHP 7
  • D.PHP 8

25) Which version of php introduced try/catch exception?

  • A. PHP 5
  • B.PHP 6
  • C.PHP 7
  • D.PHP 8

26) Which PHP function is used to find files?

  • A. file()
  • B.fold()
  • C.glob()
  • D.None of the above

27) Is php is a programming language?

  • A. Yes
  • B.No

28) PHP is a popular choice for coding blank programs.

  • A. True
  • B.False

29) Which of the following variables is not a predefined variable in PHP?

  • A. $get
  • B.$post
  • C.$request
  • D.$ask

30) Which of the following function is used to compress a string?

  • A. zip()
  • B.compress()
  • C.zip_compress()
  • D.gzcompress()

31) What will be the output of the following PHP code?

  • A. Hello World
  • B.Hello World!
  • C.Hello World! Welcome to the Online Interview Questions
  • D.None of the above

32) Which of the following is used to create a session?

  • A. $_SESSION[]
  • B.isset() function
  • C.session_start() function
  • D.session_destroy() function

33) Which version of PHP introduced the instance of keyword?

  • A. PHP 5
  • B.PHP 6
  • C.PHP 7
  • D.PHP 8

34) There are ............ error levels are available in PHP?

  • A. 15
  • B.16
  • C.17
  • D.14

35) What does SPL stands for in Php?

  • A. Source PHP List
  • B.Standard PHP List
  • C.Standard PHP Library
  • D.None of the Above

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Feb
Wordpress MCQ
01st
Oct
Selenium MCQ
01st
Feb
NoSQL MCQ
01st
Feb
MSBI MCQ
01st
Oct
Email MCQ