Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$color1 = "1";
$color2 = "1";
echo "$color1" + "$color2";
?>

A. 11

B. 2

C. 0

D. 1

Answer: Option B

Solution(By Examveda Team)

+ can be used to add to integer values which are enclosed by double-quotes.

This Question Belongs to PHP >> Operators And Expressions In Php

Join The Discussion

Related Questions on Operators and Expressions in php