PHPMailer::normalizeBreaks()public staticWP 1.0

Normalize line breaks in a string. Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. Defaults to CRLF (for message bodies) and preserves consecutive breaks.

{} It's a method of the class: PHPMailer{}

No Hooks.




$result = PHPMailer::normalizeBreaks( $text, $breaktype );
$text(string) (required)
What kind of line break to use; defaults to static::$LE
Default: null

Code of PHPMailer::normalizeBreaks() WP 6.0

public static function normalizeBreaks($text, $breaktype = null)
    if (null === $breaktype) {
        $breaktype = static::$LE;
    //Normalise to \n
    $text = str_replace([self::CRLF, "\r"], "\n", $text);
    //Now convert LE as needed
    if ("\n" !== $breaktype) {
        $text = str_replace("\n", $breaktype, $text);

    return $text;