What will be the output of the following PHP code ?
<?php
for ($count = 0; $count<3;$count++);
{
print "hi";break;print "hello";
}
?>
<?php
for ($count = 0; $count<3;$count++);
{
print "hi";break;print "hello";
}
?>
A. hihihi
B. hihellohihellohihello
C. hellohellohello
D. hi
Answer: Option D
Solution(By Examveda Team)
When break is encountered it leaves the loop.Related Questions on Control Structures(Loop in PHP)
A. how are u
B. hi
C. error
D. no output
A. hi
B. no output
C. error
D. how are u
A. how are uhello
B. hihello
C. hi
D. no output
A. true
B. false
C. error
D. no output
Join The Discussion