Return to Snippet

Revision: 33648
at October 11, 2010 21:27 by dmistriotis


Initial Code
// To remove it, simply replace it with an empty string like this : 
$str = str_replace("\n", "", $str);

//Also, if you want it to be reflected in your HTML you should replace the \n with <BR>.
$str=nl2br($str);

//Or
$str = str_replace("\n", "<BR>", $str);

Initial URL


Initial Description


Initial Title
Remove newline from string

Initial Tags
php, line

Initial Language
PHP