By OnlineInterviewQuestions.
com
PHP MCQ Quiz & Online Test
Take PHP Quiz & Online Test To test your Knowledge
We have listed below the best PHP MCQ Questions with Answers for your basic knowledge of PHP
Framework and the best preparation of PHP Interviews. This PHP MCQ Test & Quiz contains 35 best
Multiple choice questions. You have to select the right answer to every PHP MCQ Question. You can see the
correct answer by clicking the view answer link. You can also download the PHP MCQ PDF from the
download link given between the PHP Quiz.
Also, Read Best PHP interview questions.
Q1. PHP is a ............
A. Open Source Laguage
B. Widely Used Language
C. Server side scripting language
D. All of the above
Q2. The date_sunset() function returns the sunset time for a specified day and location.
A. True
B. False
Q3. Which of the following symbol is used to add multiple line comments in PHP ?
A. //
B. /* */
C. {{ }}
D. {/ \}
Q4. PHP is a case sensitive
A. True
B. False
Q5. Which sign is used to access variable of variable in PHP?
A. $$
B. $
C. #@
D. $|
Q6. Which of following is not a Superglobals in PHP?
A. $_SERVER
B. $_ENV
C. $_FILES
D. $_PUT
Q7. Which function is used to get ASCII value of a character in PHP ?
A. asc()
B. chr( )
C. ascii()
D. val( )
Q8. ______ is used to unset a variable in PHP ?
A. delete()
B. unset()
C. unlink()
D. delete();
Q9. How many error levels are available in PHP ?
A. 20
B. 4
C. 19
D. 16
Q10. In which version of PHP E_STRICT Error level is introduced ?
A. PHP 4
B. PHP 5
C. PHP 5.2
D. PHP 7
Q11. Which function in PHP is used to get the length of string variable?
A. count()
B. strcount
C. strlen
D. len
Q12. Which of the below symbols is a newline character?
A. \n
B. \r
C. /n
D. /r
Q13. Who is the father of PHP?
A. Drek Kolkevi
B. Rasmus Lerdorf
C. Willam Makepiece
D. List Barely
Q14. Type Hinting was introduced in which version of PHP?
A. PHP 5
B. PHP 5.3
C. PHP 4
D. PHP 6
Q15. 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
Q16. 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()
Q17. PHP’s numerically indexed array begin with position ___________ .
A. -1
B. 0
C. 1
D. 2
Q18. Which of the functions is used to sort an array in descending order?
A. asort()
B. sort()
C. rsort()
D. dsort()
Q19. Which one of the following property scopes is not supported by PHP?
A. public
B. final
C. friendly
D. static
Q20. PHP stands for ..........
A. Personal Home Page
B. PHP Hypertext Preprocessor
C. Pro Hypertext Preprocessor
D. None of the above
Q21. PHP files have a default file extension of .............
A. .xml
B. .html
C. .php
D. .py
Q22. Which of the following is/are a PHP code editor?
A. Notepad ++
B. VS Code Editor
C. Sublime Text
D. All of the above
Q23. 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
Q24. what is the latest version of PHP?
A. PHP 3
B. PHP 5
C. PHP 7
D. PHP 8
Q25. Which version of php introduced try/catch exception?
A. PHP 5
B. PHP 6
C. PHP 7
D. PHP 8
Q26. Which PHP function is used to find files?
A. file()
B. fold()
C. glob()
D. None of the above
Q27. Is php is a programming language?
A. Yes
B. No
Q28. PHP is a popular choice for coding blank programs.
A. True
B. False
Q29. Which of the following variables is not a predefined variable in PHP?
A. $get
B. $post
C. $request
D. $ask
Q30. Which of the following function is used to compress a string?
A. zip()
B. compress()
C. zip_compress()
D. gzcompress()
Q31. What will be the output of the following PHP code?
<ol style="border: 0px; list-style-position: initial; list-style-image: initia
<li class="li1" style="border: 0px; margin: 0px 0px 0px 20px; padding: 0px 0px 0p
<pre class="de1" style="border: none; padding: 0px; background-image: initial; ba
</li>
<li class="li1" style="border: 0px; margin: 0px 0px 0px 20px; padding: 0px 0px 0p
<pre class="de1" style="border: none; padding: 0px; background-image: initial; ba
</li>
<li class="li1" style="border: 0px; margin: 0px 0px 0px 20px; padding: 0px 0px 0p
<pre class="de1" style="border: none; padding: 0px; background-image: initial; ba
</li>
</ol>
<pre><!--?php
echo "Hello world </br> Welcome to Online Interview Questions";
?--></pre>
A. Hello World
B. Hello World!
C. Hello World! Welcome to the Online Interview Questions
D. None of the above
Q32. Which of the following is used to create a session?
A. $_SESSION[]
B. isset() function
C. session_start() function
D. session_destroy() function
Q33. Which version of PHP introduced the instance of keyword?
A. PHP 5
B. PHP 6
C. PHP 7
D. PHP 8
Q34. There are ............ error levels are available in PHP?
A. 15
B. 16
C. 17
D. 14
Q35. What does SPL stands for in Php?
A. Source PHP List
B. Standard PHP List
C. Standard PHP Library
D. None of the Above
Please Visit OnlineInterviewquestions.com to download more pdfs