$z3 = "juice"; $text = ""; if ($firstname == "z") { $text.=('. $z3 .'); } echo $text; PHP: Text should echo 'juice' Hmm.
$firstname is not defined and hence its value is blank (''). that is why if condition will become false leaving $text unchanged
Obviously this isn't right.. $text.=('. $z3 .'); It should be something like $text.=($z3); but that produces an error.