Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following PHP code?
<?php
$num = “1”;
$num1 = “2”;
print $num+$num1;
?>

What will be the output of the following PHP code?
<?php
$num = “1”;
$num1 = “2”;
print $num+$num1;
?>
a) 3
b) 1+2
c) Error
d) 12

Answer: a
Explanation: 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