Html2Text\Html2Text::fixNewlines PHP Метод

fixNewlines() статический публичный Метод

Unify newlines; in particular, \r\n becomes \n, and then \r becomes \n. This means that all newlines (Unix, Windows, Mac) all become \ns.
static public fixNewlines ( string $text ) : string
$text string text with any number of \r, \r\n and \n combinations
Результат string the fixed text
    static function fixNewlines($text)
    {
        // replace \r\n to \n
        $text = str_replace("\r\n", "\n", $text);
        // remove \rs
        $text = str_replace("\r", "\n", $text);
        return $text;
    }