?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
function mine($num)
{
$num = 2 + $num;
echo "$num";
}
mine(3);
?>
<?php
function mine($num)
{
$num = 2 + $num;
echo "$num";
}
mine(3);
?>
Answer & Solution
Correct Answer:
Option
B
The function is defined as echo “$num”.This means $num is treated as a string and not as a variable.
Join the Discussion
Login to post a comment or share your explanation.
Login