php remove new line character from string code example
Example 1: php replace return character
$string = str_replace("\n", "", $string);
$string = str_replace("\r", "", $string);
Example 2: how remove \r\n from string in php
$text = preg_replace("/\r|\n/", "", $text);
Example 3: string remove line breaks php
preg_replace( "/\r|\n/", "", $yourString );