Support » Fixing WordPress » using function maybe_unserialize()

  • Resolved avatar876575

    (@avatar876575)


    hey everyone! I have this code right here

    $custom_fields = get_post_custom($post_id);
    $my_custom_field = $custom_fields['my_custom_field'];
        foreach ( $custom_fields as $key => $value ) {
     	 echo $key . " => " .  $value  . "<br />";
     }

    The result is and array which is probably serialized. Can you help me unserialize it?

    [Moderator Note: No bumping. If it’s that urgent after waiting just 1 hour, consider hiring someone instead.]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Which part do you think is serialized? $my_custom_field? Dump it out so you can see exactly what is in it:

    print_r('<pre>MY CUSTOM FIELD:');print_r($my_custom_field);print_r('</pre>');

    Indeed. It’s an array which is serialized. But print_r did the job! Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘using function maybe_unserialize()’ is closed to new replies.