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:
Variables in Double Quoted Strings
Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?
✍: FYIcenter
In this example, "$a dollars" or "{$a} dollars" will print the same result.
But in other cases, you need to use curly braces to protect variable names. For example, for following PHP script will print different results:
<?php
$sales = 7;
echo "$sales000000 dollars\n";
echo "{$sales}000000 dollars\n";
?>
2007-02-27, 7186👍, 0💬
Popular Posts:
How can we format data inside DataGrid? Use the DataFormatString property.
What Information Is Needed to Connect SQL*Plus an Oracle Server? - Oracle DBA FAQ - Introduction to ...
What's the difference between J2SDK 1.5 and J2SDK 5.0? There is no difference, Sun Microsystems just...
How do you override a defined macro? You can use the #undef preprocessor directive to undefine (over...
What is the result of using Option Explicit? When writing your C program, you can include files in t...