Vidyalelo
PHP · all questions

Control Structures(Loop In PHP)
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

86

Questions

5/5

Page

Pick an option on a question to see the right answer and solution.

What will be the output of the following PHP code ?
<?php
$user = array("Ashley", "Bale", "Shrek", "Blank");
for (x < count(x++)
{
    if (x++] == "Shrek") 
    continue;
    printf (x]); 
}
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$user = array("Ashley", "Bale", "Shrek", "Blank");
for (x < count(x) 
{
    if (x++] == "Shrek") 
    continue;
    printf (x]); 
}
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
for (i % ++i++) 
{
    print"i";
}
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
for (i < 5; $i++) 
{
    for(; i++)         
    print"i";
}
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$a = array("hi", "hello", "bye");
foreach (value) 
{
    if (count($a) == 2)
    print $value;         
}
?>

Select an option to see the answer and solution.

What will be the output of the following PHP code ?
<?php
$a = array("hi", "hello", "bye");
for (;count($a) < 5;) 
{
    if (count($a) == 3)
    print $a;               
}
?>

Select an option to see the answer and solution.