I'm generating a string in PHP on a linux server that will be sent out as the body of an email. For carriage returns within the string, should I use [backslash]n or [backslash]r[backslash]n ?
(edited 'cause backslashes are being stripped out.)
Got a question about technology? Ask it here. Discussion of hardware, software, TiVos, multi-region DVDs, Windows, Macs, LINUX, hand-helds, iPods, anything tech related. Better than any helpdesk!
I'm generating a string in PHP on a linux server that will be sent out as the body of an email. For carriage returns within the string, should I use [backslash]n or [backslash]r[backslash]n ?
(edited 'cause backslashes are being stripped out.)
It should be \\r\\n.
Thanks, Tom. Could you explain what the practical difference is?
Most textual Internet protocols (including HTTP, SMTP, FTP, IRC and many others) mandate the use of ASCII CR+LF (0x0D 0x0A) on the protocol level, but recommend that tolerant applications recognize lone LF as well. In practice, there are many applications that erroneously use the C newline character '\\n' instead (see section Newline in programming languages below). This leads to problems when trying to communicate with systems adhering to a stricter interpretation of the standards; one such system is the qmail MTA that actively refuses to accept messages from systems that send bare LF instead of the required CR+LF.[1]
Excellent! Just what I was looking for. Thanks!!
Thanks amych (pronounced Amy-chuh)
Just because I think many of the tech people here will appreciate this from overheard in the office: [link]
IT guy: Yeah, the UI needs to be top-notch. Like the best thing you've ever done. Uh, don't spend too much time on it.
Anyone have recommendations for a 2-port KVM Switch?
OK going nuts with new monitor. Windows 7, computer starts fine in safe mode even with networking. But during normal startup says "starting windows". The little windows logo comes on fades a bit. And then screen blacks out and never comes on again even though I can hear disk go through normal bootup process. No adjustment to monitor makes windows visible. Changes in resolution no joy. Yet it boots fine in safe mode.
Gar, when I had something similar happen to me (on Windows XP) the problem turned out to be that the video card had crapped out.