?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$a = "hello";
if (strlen($a))
print strlen($a);
else
print "hi";
?>
<?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.
Join the Discussion
Login to post a comment or share your explanation.
Login