Some of PHP’s built-in functions can be quite handy. One of these is
which transforms newlines (
\n and other variants)
into HTML line breaks (
<br>) — more precisely, it puts
<br> before each newline.
It has been used, and sometimes is still used, when echoing a CLOB on a webpage.
Actually, this function is no longer necessary: with the CSS property
white-space you can do the same on the client-side in a
neat and efficient way. However, this post is just an example on how to create
something resembling PHP’s built-in functions using the instruments of
Java EE. Read more...