Solved

\n don't skip to next line

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
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 …

932 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

7 Experts available now in Live!

Get 1:1 Help Now