PHP MCQ Question and Answer

PHP MCQ Question and Answer
111. <?php
$qpt = 'QualityPointTechnologies';
echo preg_match("/^Quality/", $qpt);
?>
  • 1
  • 0
  • Quality
  • Null
Show Answer
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
113. <?php
$x=array(2=>"mouse",7=>"keyboard");
$y=array_keys($x);
echo $y[1];
?>
  • keyboard
  • mouse
  • 7
  • 2
Show Answer
114. $data="98.8degrees";
(double)$data;
(int)$data;
(string)$string;
echo $data;
?>
  • 98
  • 98.8
  • 98.8degrees
  • degrees
Show Answer
115. PHP is
  • Partially cross-platform
  • Truly cross-platform
  • None of above
Show Answer
116. <?php
$x="101.5degrees";
(double)$x;
(int)$x;
echo (string)$x;
?>
  • 101.5
  • degrees
  • 101
  • 101.5degrees
Show Answer
117. Whether One-line comment begin with pound sing(#) in php?
  • True
  • False
  • None of above
Show Answer
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
119. <?php
$qpt = 'Eat to live, but not live to eat';
echo preg_match("/^to/", $qpt);
?>
  • 0
  • 1
  • to
  • Null
Show Answer
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
Questions and Answers for Competitive Exams Various Entrance Test