Examveda
Examveda

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

A. 1grey

B. grey

C. 0

D. red1grey

Answer: Option A

Solution(By Examveda Team)

+ gives the value 1 and . is used to give join 1 and grey.

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

Join The Discussion

Related Questions on Operators and Expressions in php