|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #23501 Add mb_trim()
Submitted: 2003-05-06 01:18 UTC Modified: 2011-01-01 20:46 UTC
Avg. Score:4.5 ± 0.8
Reproduced:29 of 30 (96.7%)
Same Version:16 (55.2%)
Same OS:16 (55.2%)
From: jc at mega-bucks dot co dot jp Assigned:
Status: Open Package: mbstring related
PHP Version: * OS: *
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [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.


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

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-01 20:46 UTC]
-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: *
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Apr 23 23:01:34 2017 UTC