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, 1813🔥, 0💬
Popular Posts:
Where to find tutorials on RSS specifications? I want to learn it to describe my API services. Here ...
How To Change Text Fonts for Some Parts of a Paragraph? If you want to change text fonts or colors f...
How to use the "return-response" Policy statement to build the response from scratch for an Azure AP...
How To Get the Minimum or Maximum Value of an Array in PHP? If you want to get the minimum or maximu...
How To Copy Array Values to a List of Variables in PHP? If you want copy all values of an array to a...