PHPMailer\PHPMailer
PHPMailer::normalizeBreaks
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.
Метод класса: PHPMailer{}
Хуков нет.
Возвращает
Строку.
Использование
$result = PHPMailer::normalizeBreaks( $text, $breaktype );
- $text(строка) (обязательный)
- .
- $breaktype(строка)
- What kind of line break to use; defaults to static::$LE.
По умолчанию:null
Код PHPMailer::normalizeBreaks() PHPMailer::normalizeBreaks WP 7.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;
}