Text from database - convert to html -


I have received a text from the database and I want to convert it to an HTML code. New lines are saved in my database, but when I ask it and echo it on my HTML code, there is no new line, because I need to put some code inside.

I found it but it does not seem to work: $ html = str_replace ("\ n", "
", $ html);

Thanks for someone else's help.

Try

  $ html = nl2br ($ html);  

Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

class - Kivy: how to instantiate a dynamic classes in python -