php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #23501 Add mb_trim(), mb_rtrim() and mb_ltrim() counterparts
Submitted: 2003-05-06 01:18 UTC Modified: 2022-04-07 14:53 UTC
Votes:33
Avg. Score:4.4 ± 0.9
Reproduced:30 of 31 (96.8%)
Same Version:15 (50.0%)
Same OS:15 (50.0%)
From: jc at mega-bucks dot co dot jp Assigned: ilutov (profile)
Status: Closed Package: mbstring related
PHP Version: * OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jc at mega-bucks dot co dot jp
New email:
PHP Version: OS:

 

 [2003-05-06 01:18 UTC] jc at mega-bucks dot co dot jp
I'd like to ask that a multibyte-safe version of trim() be added to PHP. If possible with this functionality:

String trim(string str, [string encoding], [string charlist])

1- automatically determine encoding of given string and remove that encoding's "whitespace". I.e if I pass an ASCII string it would act just as the current trim(), if I pass in an SJIS string it would remove whatever is considered "whitespace" for that character set (including full-width spaces).

Automatically determining the encoding of a string is not always possible, in that case the function promises only a "best guess" at the string's encoding.

2- Optional parameter that gives the string's encoding.

3- An optional list of characters to be considered "whitespace" instead of the function's built-in default list.

Patches

cool (last revision 2012-10-26 00:45 UTC by kaissa11 at gmail dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-01 20:46 UTC] jani@php.net
-Summary: Request a multibyte-safe version of trim() +Summary: Add mb_trim() -Package: Feature/Change Request +Package: mbstring related -Operating System: Red Hat Linux 8.0 +Operating System: * -PHP Version: 4.3.2RC2 +PHP Version: *
 [2017-10-24 01:56 UTC] kalle@php.net
-Summary: Add mb_trim() +Summary: Add mb_trim(), mb_rtrim() and mb_ltrim() counterparts
 [2022-04-07 14:53 UTC] ilutov@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ilutov
 [2022-04-07 14:53 UTC] ilutov@php.net
This feature request has been open for a long time with no action. We're migrating away from bugs.php.net, if this is still desired please create a new issue on GitHub.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC