note 18043 added to function.array-map

From: Date: Tue, 08 Jan 2002 17:44:19 +0000
Subject: note 18043 added to function.array-map
Groups: php.notes 
Request: Send a blank email to php-notes+get-24539@lists.php.net to get a copy of this message
Be warned the callback function can't be one internal to PHP. If you want to pass an internal function as a callback to array_map (and probably others that take callback functions), you have to wrap it around with a custom function. For example: function mes_wrapper($str) { return mysql_escape_string($str); } array_map('mes_wrapper', array(...)); -- http://www.php.net/manual/en/function.array-map.php http://master.php.net/manage/user-notes.php?action=edit+18043 http://master.php.net/manage/user-notes.php?action=delete+18043 http://master.php.net/manage/user-notes.php?action=reject+18043

« previous php.notes (#24539) next »