ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

What will be the output of the following PHP code ?
<?php
$a = "hello";
if (strlen($a))
    print strlen($a);
else
    print "hi";
?>

Answer & Solution
Correct Answer: Option B
The function strlen($a) gives the length of the string,5, which is considered true.
Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Gow R
Gow R 3 years ago
B.5