Locale Page...  Global  |  Germany  |  UK  |  USA
Your privat CyberGadget - The finest Resources for Web-Designer, Web-Master and Web-Developer!
Quick Search
Advertisement
Partner & Friends
Developersdex
Tutorial Guide
Send News    Add URL / Entry    Tag it:digg it!Stumble It!YahooMyWeb!del.icio.us!Simpify!reddit!Netvouz!Ma.gnolia!FurlIt!Blogmarks!BlinkList!
PHP: Manual
PHP Manual by the PHP Documentation Group php.net

nl2br

(PHP 3, PHP 4 , PHP 5)

nl2br --  Inserts HTML line breaks before all newlines in a string

Description

string nl2br ( string string)

Returns string with '<br />' inserted before all newlines.

Note: Starting with PHP 4.0.5, nl2br() is now XHTML compliant. All versions before 4.0.5 will return string with '<br>' inserted before newlines instead of '<br />'.

Example 1. using nl2br()

<?php
echo nl2br("foo isn't\n bar");
?>

this will output :

foo isn't<br />
 bar

See also htmlspecialchars(), htmlentities(), wordwrap(), and str_replace().


© 2001 - 2009 CYGAD.NET | All rights reserved. | Terms of Service | About | Time data: GMT +1! | Portal Release X2.6.1 Beta | RunTime: 0.8164
Optimized for Internet Explorer Internet Explorer 6.0+, Firefox Firefox 1.5+!