str_replace()関数を使用し、改行コードを空に変換しています。
変数 $text の改行コードを削除します。

<?php
str_replace(array("\r\n","\r","\n"), '', $text);
?>

[対象]
PHP 5.x