Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 906
  • Last Modified:

\n don't skip to next line

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
mammouth
Asked:
mammouth
1 Solution
 
LordOfPortsCommented:
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
 
mammouthAuthor Commented:
Thanks
Too fast :)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now