<textarea rows="18" cols="80" style="resize:none;">
<?php
$str = str_replace('<br>', '\n', 'some text<br><br>another line of text');
echo($str);
?>
</textarea>
Output is
some text\n\nanother line of text
This is the output that i want.
some text
another line of text
Anyone know wheres the problem?
Thanks in advance
Backslashes in single quotes are interpreted literally. You want double quotes:
For details about the different ways to write string literals in php, refer to the official documentation.