Tools, FAQ, Tutorials:
Ways to Include Variables in Double-Quoted Strings in PHP
How Many Ways to Include Variables in Double-Quoted Strings?
✍: FYIcenter.com
There are 3 formats to include variables in double-quoted strings:
Here is a PHP script example of different ways to include variables in double-quoted strings:
<?php
$beer = 'Heineken';
echo "$beer's taste is great.\n";
echo "He drank some ${beer}s and water.\n";
echo "She drank some {$beer}s and water.\n";
?>
This script will print:
Heineken's taste is great. He drank some Heinekens and water. She drank some Heinekens and water.
⇒ Including Array Elements in Double-Quoted Strings in PHP
⇐ Including Variables in Double-Quoted Strings in PHP
2016-10-13, ∼2700🔥, 0💬
Popular Posts:
Where to see some Examples of Invalid JSON Values? Here are some Examples of Invalid JSON Values: 1....
Where to get the detailed description of the json_encode() Function in PHP? Here is the detailed des...
How to troubleshoot the Orderer peer? The Docker container terminated by itself. You can follow this...
How to install .NET Framework in Visual Studio Community 2017? I have the Visual Studio Installer in...
dev.FYIcenter.com is a Website for software developer looking for software development technologies,...