Home

Php Programming MCQ Question with Answer

Php Programming MCQ with detailed explanation for interview, entrance and competitive exams. Explanation are given for understanding.

Download Php Programming MCQ Question Answer PDF

Question No : 57
What will be the output of the following PHP code ?

 <?php  $i = 5;
while (--$i > 0 && ++$i){ print $i;
} ?>

5
555555555…infinitely
54321
error

Question No : 58
What will be the output of the following PHP code ?

 <?php  $color = red;
$color = green;
echo $color;
?>

red
green
red green
error

Question No : 59
What will be the output of the following PHP code ?

 <?php  $color1 = red;
$color2 = green;
echo $color1 . $color2;
?>

red
green
red green
redgreen

Question No : 60
What will be the output of the following PHP code?

 <?php  $a = array(a=>red, b=>green, c=>blue);
echo array_shift($a);
print_r ($a);
?>

green
red
redArray( [c] => green [c] => blue )
redArray( [b] => green [c] => blue )

Question No : 61
How many ways can a session data be stored?

3
4
5
6

Question No : 62
What will be the output of the following PHP code ?

 <?php  define('IF', 42);
echo IF: , IF;
?>

IF:42
No output
IF:
ERROR

Question No : 63
Which one of the following format parameter can be used to identify timezone?

T
N
E
I