PHP MCQ Questions and Answers

Practice Mode
Showing 10 of 130 questions
Q41
mysql_connect( ) does not take following parameter
  • A database host
  • B user ID
  • C password
  • D database name
Answer: Option D
Q42
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
  • A 1, 4, 2, 3, 5
  • B 4, 1, 2, 3, 5
  • C 1, 5, 4, 2, 1
  • D 4, 1, 3, 2, 5
Answer: Option A
Q43
Which of the following is not a session function?
  • A sssion_decode
  • B session_destroy
  • C session_id
  • D session_pw
Answer: Option D
Q44
When uploading a file if the UPLOAD_ERR-OK contains value 0 it means
  • A Uplaod is not successful, error occurred
  • B The file uploaded with success
  • C Uploaded file size is 0
  • D File upload progress is 0% completed
Answer: Option B
Q45
Which of the following delimiter syntax is PHP's default delimiter syntax
  • A <? php ?>
  • B <% %>
  • C <? ?>
  • D <script language="php"> </script>
Answer: Option A
Q46
Which of the following statement produce different output
  • A <?echo "This is php example"; ?>
  • B <P="This is php example"; ?>
  • C <?PHP echo "This is php example"; php?>
  • D <script language="php"> print "This is php example";</script>
Answer: Option C
Q47
Which of the following delimiter is ASP style?
  • A <% %>
  • B <? ?>
  • C <script language="php"> </script>
Answer: Option B
Q48
Php supports all four different ways of delimiting. In this context identify the false statement
  • A You can use any of the delimiting style
  • B You can use different delimiting styles in same page
  • C You can use any delimiting style but must use a single style consistently for a page
  • D Variables declared in previous blocks are remenbered on later blocks too!
Answer: Option C
Q49
Which of following commenting is supported by Php
  • A Single line c++ syntax - //
  • B Shell syntax - #
  • C Both of above
  • D None of above
Answer: Option C
Q50
To produce the output6 I love the summer time, Which of the ofllowing statement should be used?
  • A <? Php print ("<P> I love the summer time</p>"Wink;?>
  • B <? Php $ season="summer time"; print"<p> I love the $ season</p>"; ?>
  • C <?Php $ message="<p> I love the summer time </p>; ecdho $ message; ?>
  • D All of above
Answer: Option D
Questions and Answers for Competitive Exams Various Entrance Test