ID:               35036
 Updated by:       [EMAIL PROTECTED]
 Reported By:      thomas dot hebinck at digionline dot de
 Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: Linux
 PHP Version:      5.0.5
 New Comment:

Actually, you are asking for something different. I don't 
think that will be added to the language, sorry.


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

[2005-10-31 16:19:11] [EMAIL PROTECTED]

Try join() or implode().

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

[2005-10-31 16:10:46] thomas dot hebinck at digionline dot de

Description:
------------
I'd like to have a fast function, which concatenates a string to each
element of an array.

Reproduce code:
---------------
array array_concatenate ( array array, string string [, bool
to_end=true])

Something like this as a php function:

$arr=array(1,2,3,4,5,6,7,8,9,0);
$str=' test';

array_walk($arr,create_function('&$elem','$elem .= "' . $str . '";'));


Expected result:
----------------
array ( 0 => '1 test', 1 => '2 test', 2 => '3 test', 3 => '4 test', 4
=> '5 test', 5 => '6 test', 6 => '7 test', 7 => '8 test', 8 => '9
test', 9 => '0 test', )

Actual result:
--------------
;-)


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


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

Reply via email to