?
What will be the output of the following php code?
What will be the output of the following php code?
<?php
$num = "1";
$num1 = "2";
print $num+$num1;
?>
<?php
$num = "1";
$num1 = "2";
print $num+$num1;
?>
Answer & Solution
Correct Answer:
Option
A
The numbers inside the double quotes are considered as integers and not string, therefore the value 3 is printed and not 1+2.
Join the Discussion
Login to post a comment or share your explanation.
Login