Dec 12, 2005 - PHP    No Comments

PHP nl2br

echo nl2br("foo isn't\n bar");
Output:

foo isn’t
bar

What good is this you say. Well if you are like me and use striptags() in your forms you need a way to insert the linebreaks back on the echo. This will do it :)

Got anything to say? Go ahead and leave a comment!