Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

Carriage return and Line feed in PHP

I have a website developed in DreamweaverMX using PHP/MySQL.  I am testing it locally on a WindowsXP platform with an Apache webserver.

When I output something from a PHP script to a web page, I can never get carriage return or line feed to work.  I have tried every combination of \n and \r I can think of and searched the PHP manual but cannot figure out what I am doing wrong.

Here's a sample of what I'm doing - within a loop, output each time an e-mail has been sent ($mail_to has been set to an email address pulled from the db):

echo "sent email to - $mail_to\r\n";
flush();

The text and variable data come out correctly but just keep appending to the same line and wrapping.

Thanks in advance.
0
eviandell
Asked:
eviandell
1 Solution
 
errowsCommented:
If you output to HTML, you need to use <br />...
\n will change line only in the source code...
0
 
eviandellAuthor Commented:
Doh! I am such a Watson - you are such a Sherlock!  Thanks heaps!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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