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;
}
?>A. hihellobye
B. infinite loop
C. hihello
D. no output
Answer: Option D

Join The Discussion