Carriage return and Line feed in PHP
Posted on 2003-10-23
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";
The text and variable data come out correctly but just keep appending to the same line and wrapping.
Thanks in advance.