advanced code snippet search
iloveitaly on 08/31/09
php element array String key field associative item implode
08/31/09 10:02pm
1 person have marked this snippet as a favorite
umang_nine
function implode_on_key($array, $key, $sep, $prefix = '') { $string = ''; if(empty($array)) return ''; foreach($array as $element) { $string .= $prefix.$element[$key].$sep; } return substr($string, 0, -strlen($sep));}
Report this snippet Tweet
Comment:
You need to login to post a comment.