PHP 4.0 Bug #5221: word-wraping functions
| From: | russel at yorku dot ca | Date: | Sun, 25 Jun 2000 04:34:35 +0000 |
| Subject: | PHP 4.0 Bug #5221: word-wraping functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-22261@lists.php.net to get a copy of this message | ||
From: russel@yorku.ca
Operating system: any
PHP version: 4.0.0 Release
PHP Bug Type: Feature/Change Request
Bug description: word-wraping functions
I've written a patch which adds two new functions to PHP4, wordwrap & wordwrap_byte which
break a string buffer at word boundaries at a given maximum line length using either a string or
single-char delimiter respectively. The byte function is MUCH faster since it needs no memory
copying (which is why I wrote it as a separate function).
I've written this specifically for PHP-based email programs such as IMP which have major
performance problems due to the nessesity of doing this in PHP code which is still very slow at this
particular problem. I'm sure it could be useful for other purposes as well.
patch can be found on the php-dev mailing list June 20th, search subject: wordwrap
or at:
http://kavik.ccs.yorku.ca/misc/php-4.0.0-wordwrap-patch
I know there are a few developers hoping this will make it into main. If there's anything I can
do to help the process or make the patch more acceptable please let me know.
Thanks
---
Chris Russel
russel@yorku.ca