?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$i = 0;
$j = 0;
if ($i && ($j = $i + 10))
{
echo "true";
}
echo $j;
?>
<?php
$i = 0;
$j = 0;
if ($i && ($j = $i + 10))
{
echo "true";
}
echo $j;
?>
Answer & Solution
Correct Answer:
Option
B
In if condition when the first case is 0 and is an && operation then the second command is not executed.
Join the Discussion
Login to post a comment or share your explanation.
Login