php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #12521 chop(), trim() enhancements
Submitted: 2001-08-01 16:31 UTC Modified: 2001-08-03 18:19 UTC
From: e at arix dot com Assigned: jeroen (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.4pl1 OS: Linux RH 7.1
Private report: No CVE-ID: None
 [2001-08-01 16:31 UTC] e at arix dot com
it would be useful if the chop() and trim() functions accepted an optional second parameter indicating what to chop or trim, instead of simply assuming one wants to remove whitespace.  In Perl the $/ varialbe controls what is chopped, but a parameter would be nicer!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-01 16:40 UTC] jeroen@php.net
Good idea. The second parameter should IMO be a string containing all characters to be chopped, or like addcslashes.

Assigning to myself, if anyone has any objections/remarks, please mail me. I think the c-slashes way is the best.
 [2001-08-03 18:19 UTC] jeroen@php.net
In CVS, will probably be in PHP 4.0.7

It uses the addclashes way of specifying what to chop, as second parameter.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 10:01:29 2024 UTC