Occasionally your PHP script will need to break up a long line of text into several shorter lines while preserving whole words. This can happen if you’re formatting some text for printing or emailing, or you want to display preformatted text in a Web page using the pre
element.
PHP gives you a handy function, wordwrap()
, to do this job for you. This tutorial shows you how wordwrap()
works.
[Read more…] about Wrapping Text with PHP’s wordwrap() Function