php remove newline
snippet in php

php remove newline

user3965

//Replace the newline and carriage return characters
//using regex and preg_replace.
$text = preg_replace("/\r|\n/", "", $text);