What will be displayed in a browser when the following PHP code is executed:
<?php
for ($webmull = 13; $webmull < 10; $webmull++){
echo "PHP Programming";
}
echo "Answer is: $webmull";
?>
for ($webmull = 13; $webmull < 10; $webmull++){
echo "PHP Programming";
}
echo "Answer is: $webmull";
?>
Correct!
Wrong!
-
What is the outcome of this piece of code?
<?php
$webmull = "0";
if(empty){
echo "empty";
}else{
echo "not empty";
}
?>
$webmull = "0";
if(empty){
echo "empty";
}else{
echo "not empty";
}
?>
Correct!
Wrong!
-
What is the outcome of this piece of code:
<?php
$webmull = 2;
while ($webmull < 10) {
echo $webmull + 1;
if ($webmull == 6) {
break;
} $webmull += 1;
}
?>
$webmull = 2;
while ($webmull < 10) {
echo $webmull + 1;
if ($webmull == 6) {
break;
} $webmull += 1;
}
?>
Correct!
Wrong!
-
What is the outcome of this query?
<?php
$web = 3;
for ($mull = 0; $mull < 8; $mull++) {
$web = $web + $mull;
}
echo $mull;
?>
$web = 3;
for ($mull = 0; $mull < 8; $mull++) {
$web = $web + $mull;
}
echo $mull;
?>
Correct!
Wrong!
-
What is the outcome of this piece of code:
<?php
function webmull($webmull) {
switch ($webmull) {
case 'e': print('5');
break;
case 'm': echo('6');
break;
case 'b': continue;
break;
default: echo '7';
break;
}
}
webmull('w');
webmull('e');
webmull('b');
webmull('m');
?>
function webmull($webmull) {
switch ($webmull) {
case 'e': print('5');
break;
case 'm': echo('6');
break;
case 'b': continue;
break;
default: echo '7';
break;
}
}
webmull('w');
webmull('e');
webmull('b');
webmull('m');
?>
Correct!
Wrong!
-
What is the output of the following code?
<?php
$webmull = 3;
switch ($webmull) {
case 1: echo 'one'; break;
case 2: echo 'two'; break;
default: echo 'four'; break;
case 3: echo 'three'; break;
}
?>
$webmull = 3;
switch ($webmull) {
case 1: echo 'one'; break;
case 2: echo 'two'; break;
default: echo 'four'; break;
case 3: echo 'three'; break;
}
?>
Correct!
Wrong!
-
What would be the output if 'cate' remains 5 of following code?
<?php
$php = 1;
if ($php == 1) {
?>
Correct subject!
<?php
} else {
?>
Incorrect subject!
<?php
}
?>
$php = 1;
if ($php == 1) {
?>
Correct subject!
<?php
} else {
?>
Incorrect subject!
<?php
}
?>
Correct!
Wrong!
-
Output of the following code will be?
<?php
$phpRent = 250;
function webmull($Other) {
$phpRent = 250 + $Other;
return $phpRent;
}
webmull(50);
echo $phpRent;
?>
$phpRent = 250;
function webmull($Other) {
$phpRent = 250 + $Other;
return $phpRent;
}
webmull(50);
echo $phpRent;
?>
Correct!
Wrong!
-
What is the output of following code using html entity:
<?php
$phpstr = "Its 'PHP' ;code ;";
echo htmlentities($phpstr);
?>
$phpstr = "Its 'PHP' ;code ;";
echo htmlentities($phpstr);
?>
Correct!
Wrong!
-
What is returned with this piece of code?
<?php
error_reporting(E_ALL ^ E_NOTICE);
echo ( isset($php ['web']['mull'])) ? "0" : "1";
echo $variable;
echo '1';
?>
error_reporting(E_ALL ^ E_NOTICE);
echo ( isset($php ['web']['mull'])) ? "0" : "1";
echo $variable;
echo '1';
?>
Correct!
Wrong!
-

PHP Basics Quiz questions for Control Structures
I got %%score%% of %%total%% right