Embed variables directly into strings : String Interpolation « String « PHP
- PHP
- String
- String Interpolation
Embed variables directly into strings
<?php
$a = 10;
$b = 15.7;
echo "The value of \$a is $a and the value of \$b is $b\n";
echo 'The value of \$a is $a and the value of \$b is $b\n';
?>
Related examples in the same category