Examveda
Examveda

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

A. 4 = 4 + 3 + 1

B. 8

C. 8 = 4 + 3 +1

D. Error

Answer: Option A

Solution(By Examveda Team)

Again since the variables are inside double quotes we get this result.

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

Join The Discussion

Related Questions on Operators and Expressions in php