"> What will be the output of the following php code? < ?php $num = "1"; $num "> " /> " />
Sail E0 Webinar
Question
What will be the output of the following php code?
< ?php
$num = "1";
$num1 = "2";
print $num+$num1 ;
?>
Options:
A .  3
B .  1+2
C .  Error
D .  12
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.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers