When outputting user- (or client-) supplied content from a DB, you’ll often have very long line runs. For readability, you can easily break those into bit-sized lines:

The above will insert a line break into $str at every 80th character.

I’ll update this to account for content containing markup at some point.