Codice PHP:
$messaggionl2br($_POST['messaggio']);