|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-01-11 07:44 UTC] 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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 31 23:00:01 2025 UTC |
You can use array walk for that: array_walk(implode('-', $string), 'callbackFunc');