[thelist] Line breaks in plain text email

Barry Woolgar barry at burnthebook.co.uk
Mon Apr 6 10:57:28 CDT 2009


> I have tried /r, /n, \r, \n, //r, //n, %0D%0A … Everything gets printed as is

Do you have the code you're using this with? As long as you're using double quotes the newline characters should  be parsed. Depending on what you need them for, you may find the wordwrap() function useful[1].

"\n" should work fine, though obviously Microsoft, Apple and *nix each use different EOL characters (I believe \r\n, \r, \n respectively, but check that if its important).

Hope that helps


[1] http://www.php.net/wordwrap

-----Original Message-----
From: thelist-bounces at lists.evolt.org [mailto:thelist-bounces at lists.evolt.org] On Behalf Of Barney Carroll
Sent: 06 April 2009 16:19
To: thelist at lists.evolt.org
Subject: [thelist] Line breaks in plain text email

Sorry for asking what seems like a letmegooglethatforyou question but after
searching in every approachable way, I'm still stumped on this (and please
don't just give me what you think is a helpful search string):

I am writing a plain text email feedback script and can't seem to get line

I have tried /r, /n, \r, \n, //r, //n, %0D%0A … Everything gets printed as
is (except in the case of double slashes, in which case one of them gets
escaped). As far as I can see there is no PHP equivalent to writeln or
writeLine, which is irritating.

Any bright ideas?

Barney Carroll
Web designer & front-end developer

web: www.clickwork.net

mobile: +44 (0) 7594 506 381
home: +44 (0) 118 975 0020

twitter: @barneycarroll

* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 

More information about the thelist mailing list