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;
}