Skip to content
PHP Logo

What is the standard way to create line breaks in text emails using PHP?

In order to create line breaks in text emails using PHP, the standard way is to use the "\r\n" characters to represent a new line. This ensures that the email content is displayed correctly across different email clients. By including "\r\n" at the end of each line of text, you can ensure that the email is formatted properly with line breaks.

php
$email_content = "Hello, \r\nThis is a test email with line breaks. \r\nThank you for reading.";