</td> <td><?php if ($md['meta_key'] == 'mediabank_album') { $maybe_object = unserialize(utf8_encode($md['meta_value'])); } else { $maybe_object = @unserialize(utf8_encode($md['meta_value'])); } if ($maybe_object) { $type = gettype($maybe_object); if ($type != 'string') { echo $type . '<br>' . PHP_EOL; } if ($type == 'object') { arrayToList((array) $maybe_object); } elseif ($type == 'array') { arrayToList($maybe_object); } else { echo $type . ' :: '; echo_utf8($md['meta_value']); } } else { if ($md['meta_key'] == 'partner') { $partner = $conn->getPost($md['meta_value']); if ($partner) { echo $md['meta_value'] . ' | '; echo echo_utf8($partner->post_title); ?> | <a href="/post.php?idp=<?php echo $partner->ID; ?> ">info</a>
function arrayToList($arr) { echo "<ul>"; foreach ($arr as $k => $v) { echo '<li>' . $k; $v_type = gettype($v); if ($v_type != 'string') { echo " ({$v_type})"; } echo ' => '; if ($v_type == 'array') { arrayToList($v); } elseif ($v_type == 'object') { arrayToList((array) $v); } else { echo $v; } echo '</li>' . PHP_EOL; } echo "</ul>"; }