PHP MCQ Online Test Quiz Questions with Answer PDF Download

PHP MCQ Online Quiz Questions and Answer >>30 PHP MCQ On Online Quiz>>PHP MCQ Quiz & online Test Questions

PHP Quiz: PHP is mainly used for web development and it really excellent in this area. PHP stands for Hypertext PreProcessor. PHP is a server side scripting language that can be used to develop Static websites/Dynamic websites/Web applications. One of the major advantages of PHP is platform independent, meaning it can be used to Mac OS, Windows, Linux and supports most web browsers. PHP can be very tricky, so aspirants need to develop a excellent coding skills and solid technical background. PHP is still one of the most popular server-side scripting languages that are used many developer around the world. If you are beginners in this field, don’t have worry about that, try to practice the PHP MCQ Questions regularly. We have shared the 30 PHP MCQ questions for candidates who are preparing for interview. Candidates who wants to become a good developer kindly use this basic PHP online quiz questions. This is the great  way to learn this PHP Quiz. Here are the link for CSS, JAVASCRIPT and HTML, you should learn the basics steps.

Press Here for CSS MCQ Questions
Javascript MCQ Questions for exams
HTML Quiz Questions and Answer

  PHP MCQ Questions and Answer >>Online Quiz Questions 

1. Variables always start with a__________in PHP.

  1. Yen-sign
  2. Pond Sign
  3. Dollar Sign
  4. Euro Sign
Answer: Dollar-sign

2. You can test the type of any variable with the__________function.

  1. showtype()
  2. whattype()
  3. settype()
  4. gettype()

Answer: gettype()

3. Which of the following is not valid PHP code?

  1. &$something
  2. ${“MyVar”}
  3. $_10
  4. $10_somethings

Answer: $10_somethings

4. String values must be enclosed in __________

  1. single quotes
  2. double quotes
  3. Both A & B
  4. None

Answer: Both A & B

5. What is the limit of a PHP integer value?

  1. 1048576
  2. 65536
  3. 16384
  4. 2147483647

Answer: 2147483647

6. Under what circumstance is it impossible to assign a default value to a parameter while declaring a function?

  1. When the parameter is being declared as passed by reference
  2. When the function is being declared as a member of a class
  3. When the parameter is Boolean
  4. When the function contains only one parameter

Answer: When the parameter is being declared as passed by reference

7. PHP files have a default file extension of_______.

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

Answer: .php

8. How does the identity operator === compare two values?

  1. If the two values are strings, it performs a lexical comparison
  2. It returns True only if they are both of the same type and value
  3. It converts them to a common compatible data type and then compares the resulting values
  4. It converts both values to strings and compares them

Answer: It converts them to a common compatible data type and then compares the resulting values

9. Which of the below statements is equivalent to $add += $add ?

  1. $add = $add + 1c
  2. $add = $add +$ad
  3. $add = $add
  4. $add = $add + $add + 1

Answer: $add = $add +$add

11. Which of the below symbols is a newline character?

  1. \n
  2. \r
  3. /n
  4. /r

Answer: \n

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

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

Answer: PHP 5

13. Who is the father of PHP?

  1. Drek Kolkevi
  2. Willam Makepiece
  3. Rasmus Lerdorf
  4. List Barely

Answer: Rasmus Lerdorf

14. Which statement will output $x on the screen?

  1. echo “$$x”;
  2. echo “\$x”;
  3. echo “$x;”;
  4. echo “/$x”;

Answer: echo “\$x”;

15. Within a namespace, for accessing the built-in PHP classes you can prefix the class name with a ________and let PHP look in the global class list.

  1. Percent
  2. Asterix
  3. ampersand
  4. backslash
Answer: backslash

16. PHP considers the following values as False

  1. the one-character string 0
  2. the integer 0
  3. constant NULL
  4. All of Above

Answer: All of Above

17. Some PHP code might not have a namespace and therefore lives in the__________ namespace.

  1. PRE
  2. Global
  3. Default
  4. Automatic

Answer: Global

18. PHP’s numerically indexed array begin with position ______.

  1. 0
  2. 2
  3. 1
  4. -1
Answer: 0

19. Which function returns an array consisting of associative key/value pairs?

  1. array_count_values()
  2. array_count()
  3. count()
  4. count_values()

Answer: array_count_values()

20. Which function can be used to move the pointer to the previous array position?

  1. prev()
  2. before()
  3. last()
  4. previous()

Answer: prev()

21. Which in-built function will add a value to the end of an array?

  1. array_push()
  2. inend_array()
  3. into_array()
  4. array_unshift()

Answer: array_push()

22. Which function will return true if a variable is an array or false if it is not?

  1. is_array()
  2. this_array()
  3. in_array()
  4. do_array()

Answer: is_array()

23. As the namespace size grows, using namespaces can become a little repetitious, but PHP also provides the _________ statement, which allows you to alias a specific namespace.

  1. grant
  2. php
  3. use
  4. lable
Answer: use

24. A function in PHP which starts with ______ (double underscore) is know as.

  1. Inbuilt Function
  2. Magic Function
  3. Default Function
  4. User Defined Function

Answer: Magic Function

25. Type Hinting was introduced in which version of PHP?

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

Answer: PHP 5

26. Which of the below namespace declaration is correct?

  1. namespace 1_RA;
  2. namespace ORA:
  3. namespace ORA;
  4. namespace ORA_#;

Answer: namespace ORA;

27. What array will you get if you convert an object to an array?

  1. An array with keys of that object as the array’s elements
  2. An array with properties of that object as the array’s elements
  3. An array with properties of that array as the object’s elements
  4. An array with properties of that object as the Key elements

Answer: An array with properties of that object as the array’s elements

28. What function computes the difference of arrays?

  1. diff_arrays
  2. arrays_diff
  3. diff_array
  4. array_diff

Answer: array_diff

29. Assume you would like to sort an array in ascending order by value while preserving key associations. Which of the following PHP sorting functions would you use?

  1. ksort()
  2. krsort()
  3. sort()
  4. asort()

Answer: asort()

30. Which array function checks if the specified key exists in the array?

  1. array_key_exists()
  2. array_key_exist()
  3. array_keys_exists()
  4. arrays_key_exists()

Answer: array_key_exists()

Candidate to know the latest updates and upcoming exam notification kindly lock in touch with our dailyrecruitment website regularly. Candidate those are interested in this field advised to practice the above PHP multiple choice questions/PHP MCQ Questions and Answer.

Govt Jobs by Qualifications

Education & Vacancies Salary Apply Link
10th Pass Govt Jobs - 5,000 Vacancies Rs. 5,200 - 63,200 Apply Now
12th Pass Govt Jobs - 18,000+ Vacancies Rs. 5,200 - 92,300 Apply Now
ITI Pass Jobs - 3,500 Vacancies Rs. 5,200 - 35,000 Apply Now
Any Graduate Jobs - 19,100 Vacancies Rs. 5,200 - 92,300 Apply Now
Central Govt Jobs Rs. 5,200 - 17,000 Apply Now
Bank Jobs - 1,000 Vacancies Rs. 5,200 - 29,200 Apply Now
Diploma Jobs - 9,300 Vacancies Rs. 5,200 - 35,000 Apply Now
BTech/BE Jobs - 18,000 Vacancies Rs. 15,000 - 1,00,000 Apply Now
Data Entry Jobs - 1,300 Vacancies Rs. 5,200 - 29,200 Apply Now
Private Jobs Rs. 10,000 - 67,700 Apply Now