note 21461 added to function.implode

From: Date: Tue, 14 May 2002 04:43:18 +0000
Subject: note 21461 added to function.implode
Groups: php.notes 
Request: Send a blank email to php-notes+get-30615@lists.php.net to get a copy of this message
The one thing missing with this function is a way to add the keys. So I wrote this little function: function implode_with_keys($glue, $array) { $output = array(); foreach( $array as $key => $item ) $output[] = $key . "=" . $item; return implode($glue, $output); } -- http://www.php.net/manual/en/function.implode.php http://master.php.net/manage/user-notes.php?action=edit+21461 http://master.php.net/manage/user-notes.php?action=delete+21461 http://master.php.net/manage/user-notes.php?action=reject+21461

« previous php.notes (#30615) next »