$a = '12345';
// This works:
echo "qwe{$a}rty"; // qwe12345rty, using braces
echo "qwe" . $a . "rty"; // qwe12345rty, concatenation used
// Does not work:
echo 'qwe{$a}rty'; // qwe{$a}rty, single quotes are not parsed
echo "qwe$arty"; // qwe, because $a became $arty, which is undefined
phpCopy# php 7.*
<?php
$txt = "salt";
echo "{$txt}y";
?>
$name = "Jimoh"; //string is assigned to variable name
echo $name //will output "Jimoh"
phpCopy#php 7.x
<?php
$prefix = "Comfort";
$suffix = "able";
echo "{$prefix}{$suffix}";
?>
phpCopy#php 7.x
<?php
$taste = "ie";
echo sweet.$taste;
?>