ExamVeda
Login
Home
Control Structures(Loop in PHP)
?

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

Answer & Solution
Correct Answer: Option A
The expression is evaluated with values contained in the string, even without typecasting.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.