Examveda
Examveda

What will be the output of the following PHP code ?

<?php
$one = "Hello";
$two = "World";
echo "$one$two";
?>

A. HelloWorld

B. $one$two

C. Hello

D. Error

Answer: Option A

Solution(By Examveda Team)

Even though both the variables are inside the double-quotes, the value of the variable is substituted and then printed to the screen.

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

Join The Discussion

Related Questions on Operators and Expressions in php