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

71. Which of the following function can assign the output to a string variable

  • echo ( )
  • print ( )
  • print f ( )
  • s print f ( )
Show Answer Report

72.  Which of the following data type is not seal or datetype supported by PHP

  • Array
  • String
  • Float
  • Boolean
Show Answer Report

73. Which of the following data type is compound datatype supported by PHP

  • Array
  • String
  • Float
  • Boolean
Show Answer Report

74. If a boolean variable $ alive= 5;

  • $ alive is false
  • $ alive is true
  • $ alive is overflow
  • the statement is snot valid
Show Answer Report

75. For integer data type PHP 6 introduced

  • 8 bit integer value
  • 16 bit integer value
  • 32 bit integer value
  • 64 bit integer value
Show Answer Report

76. For integer data type PHP 5 and earlier supported

  • 8 bit integer value
  • 16 bit integer value
  • 32 bit integer value
  • Both Get and Post
Show Answer Report

77. <?php $x=array("aaa","ttt","www","ttt","yyy","tttt"); $y=array_count_values($x); echo $y[ttt]; ?>

  • 2
  • 3
  • 1
  • 4
Show Answer Report

78. How do you get information from a form that is submitted using the "get" method?

  • $_GET[];
  • Request.Form;
  • Request.QueryString;
  • $_POST[];
Show Answer Report

79. What's the best way to copy a file from within a piece of PHP?

  • Print out a message asking your user to "telnet" in to the server and copy the file for you
  • Open the input and output files, and use read() and write() to copy the data block by block until read() returns a zero
  • Use the built in copy() function
  • Use "exec" to run an operating system command such as cp (Unix, Linux) or copy (Windows)
Show Answer Report

80. PHP code is embedded directly into XHTML document?

  • TRUE
  • FALSE
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test