Q:

Echo an input of a textarea with line breaks

I want to echo an input of a textarea with line breaks I already try something like this to replace <br/> to a new line but it's not working:
echo '<textarea>'.nl2br('test<br/>tes2<br/>').'</textarea>';

The code is print the same text it's print test<br/>tes2<br/>

A:

An answer is on the nl2br php man page in the user comments about making a reverse nl2br function called br2nl... but in short, its is simply:
preg_replace('/\<br(\s*)?\/?\>/i', "\n", $string);

You can wrap that in a minifunction and stick it in your functions toolbox for mass usage. But credit goes to the fine folks commenting on the PHP.net manual pages! http://php.net/manual/en/function.nl2br.php

