Examveda
Examveda

What will be the output of the following PHP code ?
<?php
if (print "0")
    print "hi" ;
else
    print "how are u";
?>

A. 0how are u

B. 0hi

C. hi

D. how are u

Answer: Option B

Solution(By Examveda Team)

Expression evaluates to true as print returns 1.

Join The Discussion

Related Questions on Control Structures(Loop in PHP)