note 100820 modified in function.implode by thiago
| From: | thiago@php.net | Date: | Tue, 09 Nov 2010 12:56:47 +0000 |
| Subject: | note 100820 modified in function.implode by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-173882@lists.php.net to get a copy of this message | ||
Small function when you just want to implode on the keys of an array. Especially helpful when you
for instance create an array for database inserting in which the keys point to table row names.
Uses same function argument names as this documentation states for implode.
<?php
function implode_key($glue = "", $pieces = array()) {
$arrK = array_keys($pieces);
return implode($glue, $arrK);
}
?>
--was--
Small function when you just want to implode on the keys of an array. Especially helpful when you
for instance create an array for database inserting in which the keys point to table row names.
Uses same function argument names as this documentation states for implode.
function implode_key($glue = "", $pieces = array()) {
$arrK = array_keys($pieces);
return implode($glue, $arrK);
}
http://php.net/manual/en/function.implode.php