+ 1
What value does the following code print?
<?php $var = '0'; if ($var){ echo 'verdadero'; } else { echo 'falso'; } ?>
1 Answer
+ 3
falso
Reason : 0 is considered false. So else part will be executed.
<?php $var = '0'; if ($var){ echo 'verdadero'; } else { echo 'falso'; } ?>