Solved

\n don't skip to next line

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ignore other .htaccess 2 45
How would I do this...? 2 28
PHP PDO   How do I correctly remove record using DELETE FROM? 1 20
How do I fix this UPDATE error? 7 22
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

770 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