Grazie mille ad entrambi!

Li ho provati tutti e due e funzionano! Ho adottato il metodo nl2br(); che è più semplice e veloce.