This is an array i have
How do i get to echo something
A recursive function for a change;) I use it to output the media information for videos etc elements of which can use nested array / attributes.
function custom_print_array($arr = array()) {
$output = '';
foreach($arr as $key => $val) {
if(is_array($val)){
$output .= '- ' . ucwords(str_replace('_',' ', $key)) . ':
' . custom_print_array($val) . '
' . ' ';
}
else {
$output .= '- ' . ucwords(str_replace('_',' ', $key)) . ': ' . $val . '
';
}
}
return $output;
}