Solved

\n don't skip to next line

Posted on 2008-06-17
2
896 Views
Last Modified: 2012-08-13
I have a php file to send email.
I concat all string of the email into $m

But \n now print \n and no more add a line breakt.
What can i do to skip a line? It worked on PHP4 and no more on PHP5

$m = 'Hi,';
$m.= '\n';
$m.= 'Welcome to...';
0
Comment
Question by:mammouth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
LordOfPorts earned 50 total points
ID: 21803434
String within single quotes are interpreted literally, use double quotes to have \n interpreted as a new line, i.e.:

$m = 'Hi,';
$m.= "\n";
$m.= 'Welcome to...';

This article will have additional information that is useful http://us.php.net/manual/en/language.types.string.php#language.types.string.syntax.double
0
 
LVL 1

Author Closing Comment

by:mammouth
ID: 31467975
Thanks
Too fast :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question