#18003 [Opn->Bgs]: trim() to accept arrays as argument

From: Date: Thu, 06 Feb 2003 20:33:49 +0000
Subject: #18003 [Opn->Bgs]: trim() to accept arrays as argument
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-32318@lists.php.net to get a copy of this message
 ID:               18003
 Updated by:       iliaa@php.net
 Reported By:      carlos@wfmgh.org.pl
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: Linux
 PHP Version:      4.2.1
 New Comment:

Both array_map and array_walk can be used to implement this quite
easily. I see no reason to make a string function support array
arguments.


Previous Comments:
------------------------------------------------------------------------

[2002-11-10 18:29:03] moriyoshi@php.net

Hmm, -1 for having this feature. In simplest case, you can also use
array_map() for this purpose:

$result = array_map('trim',$array);

I don't think this code is too tedious.

------------------------------------------------------------------------

[2002-11-10 18:18:37] maxim@php.net

Trim is a stricly string function, I don't see any need giving it an
array as argument...

It is so easy to do with php by applying array_walk() to your array or
simply looping it... If your case really needs it tyou hen can just add
it into sources yourself.

On the other hand, there are already string functions that accept
arrays in place of strings returning elaborated lements...

Anyone? Leave this request or close it?

------------------------------------------------------------------------

[2002-06-26 18:10:21] carlos@wfmgh.org.pl

+1 from me to make trim() understanding array as 1st argument and in
that case trim all elements in array each by each.

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=18003&edit=1



Thread (4 messages)

« previous php.bugs (#32318) next »