Examveda
Examveda

What will be the output of the following PHP code ?
<?php
$x = 5;
$y = 10;
$z = "$x + $y";
echo "$z";
?>

A. 15

B. 10 + 5

C. $z

D. $x + $y

Answer: Option B

Solution(By Examveda Team)

Variable z will store 10 + 5 because 10 + 5 is given in double-quotes.

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

Join The Discussion

Related Questions on Operators and Expressions in php