PHP MCQ Questions and Answers
Practice ModeShowing 10 of 130 questions
Q101
what is the return value of this substr function?
<?php
$rest = substr("abcdef", -1);
$rest = substr("abcdef", 0, -1);
?>
Answer: Option A
Q102
Assume that your php file 'index.php' in location c:/apache/htdocs/phptutor/index.php. If you used basename($_SERVER['PHP_SELF']) function in your page, then what is the return value of this function ?
Answer: Option C
Q103
$x="display";
${$x.'_result'} ();
?>
Above program will call the function display_result()
Answer: Option B
Q104
All variables in PHP start with which symbol?
Answer: Option B
Q105
Father of PHP?
Answer: Option B
Q106
In PHP the error control operator is _______
Answer: Option C
Q107
$str="3dollars";
$a=20;
$a+=$str;
print($a);
?>
Output ?
Answer: Option D
Q108
<?php
function zz(& $x)
{
$x=$x+5;
}
?>
$x=10;
zz($x);
echo $x;
Answer: Option C
Q109
<?php
echo $_SERVER['REMOTE_ADDR'];
?>
Answer: Option B
Q110
<?php
$x=dir(".");
while($y=$x->read())
{
echo $y."
"
}
$y->close();
?>
What is the following output?
Answer: Option B