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. 1.+.2

D. Error

Answer: Option B

Solution(By Examveda Team)

.(dot) is used to combine two parts of the statement. Example ( $num . “Hello World” ) will output 1Hello World.

This Question Belongs to PHP >> Basic PHP

Join The Discussion

Related Questions on Basic PHP