Heya, Ajm.
Make sure you call the two functions in reverse order:
-
nl2br(htmlenitites($str));
-
instead of:
-
htmlenities(nl2br($str));
-
In terms of seeing 'rn' where your newlines go, make sure you use double quotes (e.g., "\r\n" instead of '\r\n'). PHP does not parse most control characters in single-quoted strings.