PHP Normalize Newlines/Line Endings; CRLF; CR; LF; UNIX, Windows, Mac

Reply to comment

$s = str_replace("\r\n", "\n", $s);

    $s = str_replace("\r", "\n", $s);

???

    $s = str_replace(["\r\n", "\n"], "\n", $s);