Search results for 'BR tag'. 1 post(s) found.

  1. 2009/11/27 PHP function converts new line to BR tag
2009/11/27 16:28

PHP function converts new line to BR tag


In case of displaying normal text having CR+LF character string on web browser, you may need to change it to <BR> tag.

PHP provides speedy converting function for supporting that. Following function is very useful.

Proto-type:
function nl2br( <source string> )

As you can expect by function name, it converts new line character set to <BR> tag.

Example)

.
.
.
$buf = nl2br( $source_string);
echo $buf;

Trackback 0 Comment 0

Trackback : Cannot send a trackbact to this post.