Examveda
Examveda

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

A. redgreen

B. red green

C. 0

D. error

Answer: Option C

Solution(By Examveda Team)

+ operator does not join both the strings.

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

Join The Discussion

Related Questions on Operators and Expressions in php