Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 6th, 2007, 02:35 AM
Registered User
 
Join Date: Jan 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aaaa0441
Default What's the use of braces in a string literal?

I am currently reading "Professional PHP5", I encountered the following code and do not understand the use of the curly braces, "{}". Please tell me.

print "<h1>Individual - {$objEntity->__toString()}</h1>";

May the force be with you.
 
Old January 10th, 2007, 06:04 AM
Authorized User
 
Join Date: Dec 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to paagle
Default

kk hmmm may be to keep the codes clean it could have been better if we had used for each or somethin

---
Paagle
TEAM LEADER-Team Xuberance(http://www.xuberance.com)
 
Old January 10th, 2007, 01:18 PM
Registered User
 
Join Date: Jan 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aaaa0441
Default

Anybody could give a more thorough answer, please?

May the force be with you.
 
Old January 10th, 2007, 03:51 PM
Authorized User
 
Join Date: May 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to kaos_frack
Default

curly braces do not perform any role here
probably the auhor just tried to separate the "$objEntity->__toString()" from other content preventing it from getting messed up with other text
it's just for logical separation of "$objEntity->__toString()" from other content

 
Old January 14th, 2007, 08:10 AM
Authorized User
 
Join Date: Oct 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

helo,
  curly braces is used to separate execution....

_______________________________________
.::If you quit you loss, If yo survive you win::.

.::JHANNY::.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Label vs Literal pinch BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 October 9th, 2007 01:01 PM
What's the use of braces in a string literal? aaaa0441 Pro PHP 7 January 20th, 2007 04:23 AM
Literal Control bilal589 ASP.NET 1.0 and 1.1 Basics 5 August 19th, 2006 01:42 PM
Using right() to return a literal value Somed00d Access 4 February 8th, 2006 02:56 PM
Where are Curly Braces required? ababb BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 January 20th, 2005 11:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.