Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How Many Ways to Include Variables in Double-Quoted Strings
How Many Ways to Include Variables in Double-Quoted Strings? - PHP Script Tips - Understanding String Literals and Operations
✍: 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.
2007-04-20, 4985👍, 0💬
Popular Posts:
How could Java classes direct program messages to the system console, but error messages, say to a f...
What will be printed as the result of the operation below: #define swap(a,b) a=a+b;b=a-b;a=a-b; void...
How To Get the Uploaded File Information in the Receiving PHP Script? Once the Web server received t...
What is the difference between "printf(...)" and "sprintf(...)"? sprintf(...) writes data to the cha...
How Many Tags Are Defined in HTML 4.01? There are 77 tags defined in HTML 4.01: a abbr acronym addre...