remove line breaks php code example
Example 1: how remove \r\n from string in php
$text = preg_replace("/\r|\n/", "", $text);
Example 2: remove line break html php
preg_replace( "/\r|\n/", "", $yourString );
Example 3: php remove newline
//Replace the newline and carriage return characters
//using regex and preg_replace.
$text = preg_replace("/\r|\n/", "", $text);