I have a text area written in html.
I want to get its text with PHP, but I want to replace newlines with < br / > tags.
Then the resulting string is written into a text file.
$puhdas['arvostelu'] = str_replace(array("\r\n", "\n", "\r"), '<br />', strip_tags($_POST['arvostelu']));
Why that doesn’t replace them? I can still see newlines breaking the text apart in the txt file PHP creates.
PHP already has nl2br
Please note that they might also as well be
\tinstead of\n