note 21461 deleted from function.implode by hholzgra
| From: | hholzgra@php.net | Date: | Thu, 02 Aug 2012 13:13:18 +0000 |
| Subject: | note 21461 deleted from function.implode by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189712@lists.php.net to get a copy of this message | ||
Note Submitter: static
----
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);
}