0

I want to fetch only 'email' values, right now whole array is getting fetched.

0 => a:3:{s:4:"name";s:5:"Test3";s:5:"email";s:29:"test3@gmail.com";s:7:"message";s:4:"Test message";}

Code:

<?php
global $post;
    $post = $wp_query->post;
    $id = $post->ID;

$custom_fields = get_post_custom($id);
  $my_custom_field = $custom_fields['offer'];
  foreach ( $my_custom_field as $key => $value ) {
    echo $key . " => " . $value . "<br />";
  } ?>
Sanad
  • 23
  • 4
  • 1
    Does this answer your question? [How to use php serialize() and unserialize()](https://stackoverflow.com/questions/8641889/how-to-use-php-serialize-and-unserialize) – CBroe Sep 24 '21 at 09:57

0 Answers0