Jump to content

[SOLVED] concatenating a string variable within lines


Recommended Posts

Hi

I have the following code to concatenate a variable (which is later emailed). When it is emailed it is emailed in 2 lines of HTML and this causes problems with the links. Can anyone tell me how to code this so that the HTML it creates is in multiple lines ie the string variable is in multiple lines

 

Thanks

Robert

 

 

$message .="Waterfront & Waterview Properties<br>";
$message .="<a href='http://www.website.com/articles/1.html' target='_blank'>[Read]</a><br><br>";
$message .="Making Money from Real Estate Investments on PEI<br>";
$message .="<a href='http://www.website.com/articles/2.html' target='_blank'>[Read]</a><br><br>";
$message .="Why do people move to PEI?<br>";
$message .="<a href='http://www.website.com/articles/3.html' target='_blank'>[Read]</a><br><br>";
$message .="PEI as a Tourist Destination<br>";
$message .="<a href='http://www.website.com/articles/4.html' target='_blank'>[Read]</a><br><br>";
$message .="The Purchasers Point of View<br>";
$message .="<a href='http://www.website.com/articles/7.html' target='_blank'>[Read]</a><br><br>";
$message .="What to expect when selling your home.<br>";
$message .="<a href='http://www.website.com/articles/8.html' target='_blank'>[Read]</a><br><br>";
$message .="The Days of Posting a Sign on your lawn to sell your home are gone!<br>";
$message .="<a href='http://www.website.com/articles/9.html' target='_blank'>[Read]</a><br><br>";
$message .="Retire to Summerside Prince Edward Island<br>";
$message .="<a href='http://www.website.com/articles/10.html' target='_blank'>[Read]</a><br><br>";
$message .="Acquiring PEI Real Estate as a Non Resident<br>";
$message .="<a href='http://www.website.com/articles/6.html' target='_blank'>[Read]</a><br><br>";
$message .="Properties without Services<br>";
$message .="<a href='http://www.website.com/articles/5.html' target='_blank'>[Read]</a><br><br>";

you mean you want a new line at the end of each? i don't see how that will make a difference but....

$message .="Waterfront & Waterview Properties<br>\n";
$message .="<a href='http://www.website.com/articles/1.html' target='_blank'>[Read]</a><br><br>\n";
$message .="Making Money from Real Estate Investments on PEI<br>\n";
$message .="<a href='http://www.website.com/articles/2.html' target='_blank'>[Read]</a><br><br>\n";
$message .="Why do people move to PEI?<br>\n";
$message .="<a href='http://www.website.com/articles/3.html' target='_blank'>[Read]</a><br><br>\n";
$message .="PEI as a Tourist Destination<br>\n";
$message .="<a href='http://www.website.com/articles/4.html' target='_blank'>[Read]</a><br><br>\n";
$message .="The Purchasers Point of View<br>\n";
$message .="<a href='http://www.website.com/articles/7.html' target='_blank'>[Read]</a><br><br>\n";
$message .="What to expect when selling your home.<br>\n";
$message .="<a href='http://www.website.com/articles/8.html' target='_blank'>[Read]</a><br><br>\n";
$message .="The Days of Posting a Sign on your lawn to sell your home are gone!<br>\n";
$message .="<a href='http://www.website.com/articles/9.html' target='_blank'>[Read]</a><br><br>\n";
$message .="Retire to Summerside Prince Edward Island<br>\n";
$message .="<a href='http://www.website.com/articles/10.html' target='_blank'>[Read]</a><br><br>\n";
$message .="Acquiring PEI Real Estate as a Non Resident<br>\n";
$message .="<a href='http://www.website.com/articles/6.html' target='_blank'>[Read]</a><br><br>\n";
$message .="Properties without Services<br>\n";
$message .="<a href='http://www.website.com/articles/5.html' target='_blank'>[Read]</a><br><br>\n";

 

 

Hi

Putting the \n at the end of the line comes through ie OE will actually show the \n. What I am trying to do is the same that you can do in Visual Basic by ending a line with "& vbCrlf" like this

message = "Blah Blah Blah<br>" & vbCrLf

 

what I really want to do to use an old fashioned term is add a carriage return

 

Thanks

Putting the \n at the end of the line comes through ie OE will actually show the \n.

 

Not if your strings are within double quotes.

 

what I really want to do to use an old fashioned term is add a carriage return

 

Which is exactly what \n is.

Thanks Everyone:

I used

 

$message="1st line

2nd line

3rd line";

 

and this seemed to work for me - I did try using \r and \n within "" and it reproduced in OE like

 

This is my line of text \n

However everything is solved now

Thanks Again

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.