ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

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

Answer & Solution
Correct Answer: Option D
As count($a) returns 3 the condition is always false.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.