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

111. <?php $qpt = 'QualityPointTechnologies'; echo preg_match("/^Quality/", $qpt); ?>

  • 1
  • 0
  • Quality
  • Null
Show Answer Report

112. <?php $test="3.5seconds"; settype($test,"double"); settype($test,"integer"); settype($test,"string"); print($test); ?> What is the following output?

  • 3.5
  • 3.5seconds
  • 3
  • 3seconds
Show Answer Report

113. <?php $x=array(2=>"mouse",7=>"keyboard"); $y=array_keys($x); echo $y[1]; ?>

  • keyboard
  • mouse
  • 7
  • 2
Show Answer Report

114. $data="98.8degrees"; (double)$data; (int)$data; (string)$string; echo $data; ?>

  • 98
  • 98.8
  • 98.8degrees
  • degrees
Show Answer Report

115. PHP is

  • Partially cross-platform
  • Truly cross-platform
  • None of above
Show Answer Report

116. <?php $x="101.5degrees"; (double)$x; (int)$x; echo (string)$x; ?>

  • 101.5
  • degrees
  • 101
  • 101.5degrees
Show Answer Report

117. Whether One-line comment begin with pound sing(#) in php?

  • True
  • False
  • None of above
Show Answer Report

118. In PHP, during error handling include() generates......................

  • a fatal error, and the script will stop
  • a warning, but the script will continue execution
  • None of the above
Show Answer Report

119. <?php $qpt = 'Eat to live, but not live to eat'; echo preg_match("/^to/", $qpt); ?>

  • 0
  • 1
  • to
  • Null
Show Answer Report

120. <?php $x=array("aaa","","ccc","ddd",""); $y=array_unique($x); echo count($x) . "," . count($y); ?>

  • 3,1
  • 3,3
  • 5,5
  • 5,4
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test