#14643 [Opn->Csd]: wordwrap() only for long words

From: Date: Fri, 07 Feb 2003 03:16:08 +0000
Subject: #14643 [Opn->Csd]: wordwrap() only for long words
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-32354@lists.php.net to get a copy of this message
ID: 14643 Updated by: iliaa@php.net Reported By: pulstar@mail.com -Status: Open +Status: Closed Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.0.6 New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2001-12-21 10:22:14] pulstar@mail.com The function wordwrap() could work in another fashion, breaking only words bigger than the specified width instead of break all lines. The web browsers always break text at spaces, fiting it in the web page. But if a somebody post a message with very long words (example: HEEEEEEEEEEEEEEEEEEEEEEEELLLLLLLLLLLLLOOOOOOOOOOOOOOOOOOOOOOOOOHOOOOWWWWWWWAREEEEEEEEEEEEEEEEEYOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOUUUUUUUUUUUUUUUUUUUUU????????????????????), it will stretch the page, showing the horizontal scrollbar and making a mess in the layout. With the actual wordwrap(), it will break all lines of text, so when I need to use the nl2br(), the text will appear as a small column in the left. I need to use ns2br(), or the posts will appear "compacted". So, if wordwrap() break only long words at specified width that will depend of my layout, everything will be fine. I think such behavior could work with a little differece in the cut parameter. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=14643&edit=1

« previous php.bugs (#32354) next »