PHP MCQ Question and Answer
PHP MCQ Question and Answer
111. <?php
$qpt = 'QualityPointTechnologies';
echo preg_match("/^Quality/", $qpt);
?>
$qpt = 'QualityPointTechnologies';
echo preg_match("/^Quality/", $qpt);
?>
- 1
- 0
- Quality
- Null
112. <?php
$test="3.5seconds";
settype($test,"double");
settype($test,"integer");
settype($test,"string");
print($test);
?>
What is the following output?
$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
113. <?php
$x=array(2=>"mouse",7=>"keyboard");
$y=array_keys($x);
echo $y[1];
?>
$x=array(2=>"mouse",7=>"keyboard");
$y=array_keys($x);
echo $y[1];
?>
- keyboard
- mouse
- 7
- 2
114. $data="98.8degrees";
(double)$data;
(int)$data;
(string)$string;
echo $data;
?>
(double)$data;
(int)$data;
(string)$string;
echo $data;
?>
- 98
- 98.8
- 98.8degrees
- degrees
116. <?php
$x="101.5degrees";
(double)$x;
(int)$x;
echo (string)$x;
?>
$x="101.5degrees";
(double)$x;
(int)$x;
echo (string)$x;
?>
- 101.5
- degrees
- 101
- 101.5degrees
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
119. <?php
$qpt = 'Eat to live, but not live to eat';
echo preg_match("/^to/", $qpt);
?>
$qpt = 'Eat to live, but not live to eat';
echo preg_match("/^to/", $qpt);
?>
- 0
- 1
- to
- Null
120. <?php
$x=array("aaa","","ccc","ddd","");
$y=array_unique($x);
echo count($x) . "," . count($y);
?>
$x=array("aaa","","ccc","ddd","");
$y=array_unique($x);
echo count($x) . "," . count($y);
?>
- 3,1
- 3,3
- 5,5
- 5,4