-
What will be the output of the following PHP code ?
<?php
$arr = array("Hello", "Interview", "Mania");
foreach ($arr as $val)
{
if (count($arr) == 2)
print $val;
}
?>
-
- Nothing
- Error
- HelloInterviewMania
- InterviewHelloMania
- None of these
Correct Option: D
As count($arr) returns 3 the condition is always false.