Examveda
Examveda

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

A. red

B. green

C. red green

D. error

Answer: Option B

Solution(By Examveda Team)

The variable contains the last value which has been assigned.

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

Join The Discussion

Related Questions on Operators and Expressions in php