?
What will be the output of the following PHP code ?
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;
}
?>
<?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.
Join the Discussion
Login to post a comment or share your explanation.
Login