Solved

\n don't skip to next line

Posted on 2008-06-17
2
892 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
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
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 create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now