Examveda
Examveda

What will be the output of the following PHP code ?
<?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.

This Question Belongs to PHP >> Control Structures(Loop In PHP)

Join The Discussion

Related Questions on Control Structures(Loop in PHP)