+ 1

What value does the following code print?

<?php $var = '0'; if ($var){ echo 'verdadero'; } else { echo 'falso'; } ?>

11th Mar 2018, 3:58 PM
Luis SB
Luis SB - avatar
1 Answer
+ 3
falso Reason : 0 is considered false. So else part will be executed.
11th Mar 2018, 5:01 PM
cHiRaG GhOsH
cHiRaG GhOsH - avatar