Print bank contents with line break [duplicate]

1

I have a content in the bank, which has break and line:

linha 1
linha 2
linha 3

When printing on <textarea> , the breaks work perfectly.

But if you print on a <td> , it does not make the breaks.

Is there any command to respect the breaks?

    
asked by anonymous 26.03.2018 / 14:52

1 answer

1

Using nl2br :

echo nl2br($string);

Official Manual

    
26.03.2018 / 15:06