Implode On Array Item Key
Copy this code and paste it in your HTML
function implode_on_key($array, $key, $sep, $prefix = '') {
$string = '';
if(empty($array)) return '';
foreach($array as $element) {
$string .= $prefix.$element[$key].$sep;
}
}
Report this snippet
Comments
Subscribe to comments