Parse Error --Help Please

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
skm376
Forum Newbie
Posts: 4
Joined: Thu Apr 13, 2006 11:57 am

Parse Error --Help Please

Post by skm376 »

Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I am trying to format the body of a plain text email I want my script to send.  I might be doing this completely wrong.  I get this error when I try and run the script:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING

Here is the code:

Code: Select all

$body = 'Peel, Inc.' "\n"
'Weekly ShopDani Inventory Updates' "\n"
date('jS F Y') "\n"
"\t" .$jewelryName. "\t" .$oldAmt. "\t" .$newAmt. "\n";
Am I going about this completely wrong? How can I fix this bug...Thanks


Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

If you want to concatenate strings, you have to use .

'foo' . 'bar' . "barfoo";
Post Reply