note 56281 deleted from function.implode by hholzgra
| From: | hholzgra@php.net | Date: | Thu, 02 Aug 2012 13:16:53 +0000 |
| Subject: | note 56281 deleted from function.implode by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189727@lists.php.net to get a copy of this message | ||
Note Submitter: pr10n at spymac dot com
----
A little tweak on info at urbits dot com's suggestion just incase someone changes their value
of $outglue:
<?php
function implode_with_key($assoc, $inglue = '=', $outglue = '&')
{
$return = null;
foreach ($assoc as $tk => $tv) $return .= $outglue.$tk.$inglue.$tv;
return substr($return,strlen($outglue));
}
?>