September 2001
Intermediate to advanced
768 pages
32h 45m
English
string nl2br(string string) Converts newlines to <br /> tags.
Returns:
String
Description:
nl2br() is used to convert each newline ("\n") within a string to an XHTML break (<br />) tag followed by a newline.
Prior to PHP version 3.0.18/4.0.4, the break tag was HTML compliant (<br>). In subsequent versions, the HTML/XML/XHTML-compliant form <br /> is used.
Version:
PHP 3+, PHP 4+ (<br /> tag was HTML compliant until PHP 3.0.18/4.0.4)
Example:
<?php // From http://www.foldoc.org/ - search for 'AI koan' $message = <<<_AI_KOAN_ A disciple of another sect once came to Drescher as he was eating his morning meal. "I would like to give you this personality test", said the outsider, "because I want you to be happy." ... |
Read now
Unlock full access