Categories:
.NET (357)
C (330)
C++ (184)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (2)
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, 7329👍, 0💬
Popular Posts:
How To Control Vertical Alignment? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells By d...
How do we configure “WebGarden”? “Web garden” can be configured by using process model settings in...
.NET INTERVIEW QUESTIONS - What is the difference between thread and process? A thread is a path of ...
How To Select All Columns of All Rows from a Table? - MySQL FAQs - SQL SELECT Query Statements with ...
What is the benefit of using an enum rather than a #define constant? The use of an enumeration const...