How to replace new line character with br

$tempString = “Hello is testing for new line\n to br”;

$tempString =~ s/\n/<br\/>/;

output = “Hello is testing for new line
to br”;

By admin

Related Post

One thought on “nl2br in perl”

Leave your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.