#40097 [Opn->WFx]: Using functions on each implode()-item

From: Date: Thu, 11 Jan 2007 08:09:07 +0000
Subject: #40097 [Opn->WFx]: Using functions on each implode()-item
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-107452@lists.php.net to get a copy of this message
ID: 40097 Updated by: derick@php.net Reported By: marcel dot normann at experimentierkasten dot de -Status: Open +Status: Wont fix Bug Type: Feature/Change Request Operating System: all PHP Version: 6CVS-2007-01-11 (CVS) New Comment: You can use array walk for that: array_walk(implode('-', $string), 'callbackFunc'); Previous Comments: ------------------------------------------------------------------------ [2007-01-11 07:44:07] marcel dot normann at experimentierkasten dot de Description: ------------ implode() is often used for doing such things like $sSql = "select * from somewhere where something in ('".implode("','",$aArray)."')"; This is nice for SQL injection. Maybe it would be a good idea to add a possibility to implode() for manipulating each implode()-item: string implode ( string glue, array pieces [, callback callback]) $aArray = array('some','boring','items'); echo implode('-',$aArray,'ucfirst'); // = Some-Boring-Items This example is not very usefull but imgine the use of mysql_escape_string() instead. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40097&edit=1

« previous php.bugs (#107452) next »