php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #5221 word-wraping functions
Submitted: 2000-06-25 06:34 UTC Modified: 2000-07-22 03:15 UTC
From: russel at yorku dot ca Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.0 Release OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: russel at yorku dot ca
New email:
PHP Version: OS:

 

 [2000-06-25 06:34 UTC] russel at yorku dot ca
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-29 08:56 UTC] russel at yorku dot ca
updated to add to string.c instead of html.c
same location
-Chris
 [2000-07-22 03:15 UTC] david at cvs dot php dot net
added wordwrap function
params 2 and 3 now optional (default to 75 and "\n" respectively)
wordwrap_byte now an automatic special case of wordwrap

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 03 07:01:33 2024 UTC