Просмотр поста

.
reaper

Ещё вариант:

[~] >>> cat t.php
<?php
$s = "new\n\line\r\nanother line";
echo $s;
echo "\n------------------\n";
$s = preg_replace('~[\r\n]~', '', $s);
echo $s;
[~] >>> php t.php
new
\line
another line
------------------
new\lineanother line