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

41. mysql_connect( ) does not take following parameter

  • database host
  • user ID
  • password
  • database name
Show Answer Report

42. Study following steps and determine the correct order (1)   Open a connection to MySql server (2)   Execute the SQL query (3)   Fetch the data from query (4)   Select database (5)   Close Connection

  • 1, 4, 2, 3, 5
  • 4, 1, 2, 3, 5
  • 1, 5, 4, 2, 1
  • 4, 1, 3, 2, 5
Show Answer Report

43. Which of the following is not a session function?

  • sssion_decode
  • session_destroy
  • session_id
  • session_pw
Show Answer Report

44. When uploading a file if the UPLOAD_ERR-OK contains value 0 it means

  • Uplaod is not successful, error occurred
  • The file uploaded with success
  • Uploaded file size is 0
  • File upload progress is 0% completed
Show Answer Report

45. Which of the following delimiter syntax is PHP's default delimiter syntax

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

46. Which of the following statement produce different output

  • <?echo "This is php example"; ?>
  • <P="This is php example"; ?>
  • <?PHP echo "This is php example"; php?>
  • <script language="php"> print "This is php example";</script>
Show Answer Report

47. Which of the following delimiter is ASP style?

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

48. Php supports all four different ways of delimiting. In this context identify the false statement

  • You can use any of the delimiting style
  • You can use different delimiting styles in same page
  • You can use any delimiting style but must use a single style consistently for a page
  • Variables declared in previous blocks are remenbered on later blocks too!
Show Answer Report

49. Which of following commenting is supported by Php

  • Single line c++ syntax - //
  • Shell syntax - #
  • Both of above
  • None of above
Show Answer Report

50. To produce the output6 I love the summer time, Which of the ofllowing statement should be used?

  • <? Php print ("<P> I love the summer time</p>"Wink;?>
  • <? Php $ season="summer time"; print"<p> I love the $ season</p>"; ?>
  • <?Php $ message="<p> I love the summer time </p>; ecdho $ message; ?>
  • All of above
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test