Php replaces textbox carriage return with html line feed code _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Php replaces textbox carriage return with html line feed code. The source of MailBody is sometimes the text content in TextBox. However, if you do not process the text content, the text will not have any format, and it will be squeezed together and displayed row by row. The source of the current Mail Body is sometimes the text content in TextBox. However, if the text content is not processed, the text will not have any format, and will be displayed row by row. What we are talking about now is how to make text content line break without being crowded together.
During single-step debugging, we will find that in the obtained text content, the line feed in the text is replaced with "rn", because it has never been found, leading to a large circle. After finding this cause, you can replace this string with
.
Ex: string strBody = Body. Replace ("rn ","
");
Although it was easy, it was really a headache when I didn't know it at the time. I hope it will be useful to you too.


Instance


If ($ _ POST ){
Echo str_replace (chr (13 ),'
', $ _ POST [' t']);

}
?>

For more details, see http://www.bKjia. c0m/phper/29/ff8b04e8f5b663b8b86d960321efcc83.htm

The source of the http://www.bkjia.com/PHPjc/632273.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/632273.htmlTechArticleMail Body is sometimes directly the text content in TextBox, but if there is no processing of the text content, the text will have no format, crowded together, display row by row. Now...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.