ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

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;               
}
?>

Answer & Solution
Correct Answer: Option A
As count($a) returns 3 the condition is always true, thus it prints $a, which returns its data type.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.