note 114224 deleted from function.implode by levim
| From: | levim@php.net | Date: | Tue, 18 Mar 2014 02:52:06 +0000 |
| Subject: | note 114224 deleted from function.implode by levim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-198940@lists.php.net to get a copy of this message | ||
Note Submitter: mgrigaut at free dot fr
----
@ jento & thibaut :
This is what I generally use for a clean list of items :
function implode_r($glue,$arr){
$ret_str = "";
$separator = "";
foreach($arr as $a){
$ret_str .= (is_array($a)) ? implode_r($glue,$a) : $separator . strval($a);
$separator = $glue ;
}
return $ret_str;
}