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, 1446🔥, 0💬
Popular Posts:
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The a...
How to use "link" command tool to link objet files? If you have object files previously compiled by ...
Where to find tutorials on HTML language? I want to know how to learn HTML. Here is a large collecti...
How to add request URL Template Parameters to my Azure API operation to make it more user friendly? ...
What properties and functions are supported on requests.models.Response objects? "requests" module s...