Examveda
Examveda

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: Option A

Solution(By Examveda Team)

The numbers inside the double quotes are considered as integers and not string, therefore the value 3 is printed and not 1+2.

This Question Belongs to PHP >> Basic PHP

Join The Discussion

Related Questions on Basic PHP