$customs = get_post_custom(ID);
foreach ( $customs as $key => $val ) {
echo '<tr>';
echo '<td>', esc_html( $key ), '</td><td>';
if ( count( $val ) === 1 ) {
$val = maybe_unserialize( $val[0] );
if ( ! is_array( $val ) ) {
echo esc_html( $val );
}
else {
echo '<pre>', esc_html( print_r( $val, 1 ) ), '</pre>';
}
}
else {
foreach ( $val as $v ) {
echo esc_html( $v ), '<br/>';
}
}
echo '</td></tr>';
echo '</tr>';
}