PHP MCQ Questions and Answers

Take Exam

PHP MCQ Questions with Answers help candidates strengthen their programming fundamentals and web development logic through objective-style practice. These PHP programming questions and answers are essential for cracking technical interviews and online coding assessments conducted by top recruiters like TCS, Infosys, Cognizant, and Wipro. Each question tests key PHP concepts such as syntax, data types, arrays, functions, form handling, and error management. Practicing these programming MCQs not only enhances problem-solving speed but also builds confidence for real-time technical evaluations. Whether you are preparing for placement drives, semester exams, or web development roles, this PHP MCQ collection with explanations and solutions PDF will help you master PHP efficiently. Begin your programming test practice online now and ace your upcoming PHP interview round.

PHP MCQ

Showing 10 of 130 questions

21. When compared to the compiled program, scripts run

  • Faster
  • Slower
  • The execution speed is similar
  • All of above
Show Answer Report

22. PHP is a widely used ……………. scripting language that is especially suited for web development and can be embedded into html

  • Open source general purpose
  • Proprietary general purpose
  • Open source special purpose
  • Proprietary special purpose
Show Answer Report

23. Which of the following is not true?

  • PHP can be used to develop web applications.
  • PHP makes a website dynamic.
  • PHP applications can not be compiled.
  • PHP can not be embedded into html.
Show Answer Report

24. The most portable version of PHP tag that is compatible to embed in XML or XHTML too is:

  • <? ?>
  • <script language=”php”> </script>
  • <% %>
Show Answer Report

25. The most portable version of PHP tag that is compatible to embed in XML or XHTML too is:

  • <? ?>
  • <script language=”php”> </script>
  • <% %>
Show Answer Report

26. Which of the following variables is not a predefined variable?

  • $get
  • $ask
  • $request
  • $post
Show Answer Report

27. You can define a constant by using the define() function. Once a constant is defined

  • It can never be changed or undefined
  • It can never be changed but can be undefined
  • It can be changed but can not be undefined
  • It can be changed and can be undefined
Show Answer Report

28. The following piece of script will output: &lt;? $email=&rsquo;admin@psexam.com&rsquo;; $new=strstr($email, &lsquo;@&rsquo;Wink; print $new; ?&gt;

  • admin
  • admin@psexam
  • @psexam.com
  • psexam.com
Show Answer Report

29. Which of the following function returns the number of characters in a string variable?

  • count($variable)
  • len($variable)
  • strcount($variable)
  • strlen($variable)
Show Answer Report

30. When you need to obtain the ASCII value of a character which of the following function you apply in PHP?

  • chr( );
  • asc( );
  • ord( );
  • val( );
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test