[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

Format text into html

Hi,
I have some texts in my SQL db that I would like to format into Html

E.g.
Hello
world

Must be formatted in
Hello<br>
world

Thank you for any help.

      public static function formatInHtml($str) {
            [...]
      }
0
matthew016
Asked:
matthew016
1 Solution
 
bansidharCommented:
if it is just this much of formatting

echo nl2br($str);
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now