php.net |  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
Votes:28
Avg. Score:4.4 ± 0.9
Reproduced:27 of 28 (96.4%)
Same Version:16 (59.3%)
Same OS:16 (59.3%)
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.

Patches

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

Add a Patch

Pull Requests

Add a Pull Request

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: *
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 20:02:01 2014 UTC