<p>I have a form with a <code>&lt;textarea&gt;</code> and I want to capture any line breaks in that textarea on the server-side, and replace them with a <code>&lt;br/&gt;</code>.</p>

<p>Is that possible?</p>

<p>I tried setting <code>white-space:pre</code> on the <code>textarea</code>'s CSS, but it's still not enough.</p>

Have a look at the
```
nl2br()
```
function. It should do exactly what you want.