Welcome to the Graphic and Web Design Forum
your forum for all things Design
- » Graphic Design
- » Web Design
- » Logos and Branding
- » Illustration
- » Photography
- » Design Tutorials
- » Plenty of Off Topic Chat
Register now to remove this ad box
Thread: Line breaks in PHP
26-02-2007, 04:07 AM #1
Line breaks in PHP
REGISTER TO REMOVE ADS
have a Flash contact form that send data to a PHP post script. That then send s the info to an e-mail account, but when it gets there the info doesn't have any breaks.
Is there a way to put breaks in the content that the e-mail shows? Please help.
Also, if you could show me an example it would help because Im not to familiar with PHP syntax. Sorry for asking for so much. Please help!
Thanks muchI do websites at thestudio23.net
26-02-2007, 09:11 PM #2
I think it's something like this to force a line feed.
"\n"It's not what you know or who you know, it's what you know about who you know !!!
Website design you CAN afford
27-02-2007, 09:54 AM #3
24-04-2007, 04:24 AM #4
If you are using double quotes (") around your body content, you can use \n for a line break. However, if you are using single quotes (') around your body, you can simply enter a line.
$body = "Line One\nLine Two";
This would come out as:
$body = 'Line One
This would also come out as:
Line Two29FIVE Designs - Providing Helpdesk Support Software And Website Design
imagine... create... innovate
06-07-2012, 09:12 AM #5
Line break in PHP
To create a line break in PHP, all you have to do is put the code
in the echo statement.
Check out this tutorial:
How to Create a Line Break in PHP
06-07-2012, 08:47 PM #6
website | not a website - great design forces grokking.
- Join Date
- Oct 2007
- Columbus, Ohio, United States
10-07-2012, 09:38 AM #7
Yes, as said previously the code for a line break is simply \n - an example of this for use in a contact form would be:
$msg = "Name: ".$_POST["name"]."\n";
$msg .= "E-Mail: ".$_POST["email"]."\n";
$msg .= "Comment: ".$_POST["comment"]."\n";
15-10-2012, 10:29 AM #8
REGISTER TO REMOVE ADS
<?php echo nl2br("One line.\nAnother line."); ?>
One line. Another line.
By Toon in forum Illustration Graphic DesignReplies: 3Last Post: 25-02-2009, 12:59 PM
By Picha in forum Graphic Design Business ForumReplies: 2Last Post: 14-02-2008, 12:01 PM
By Toon in forum Graphic Design and Web Design HelpReplies: 17Last Post: 02-10-2007, 01:06 PM