title: Storing Json value in add_post_meta
body: <p>How can I store this Json value in add_post_meta</p>
  
  <pre><code>  $offer_name= $item['data'][$i]['Offer']['name'];
  
    add_post_meta($post_id, 'offer_name', $offer_name);
  </code></pre>
  
  <p>The json value of $offer_name doesn't get stored but normal string get stored.</p>
  
  <p>Update 1: this is how I tested .</p>
  
  <p>case 1 // With json the value doesn't  get stored..</p>
  
  <pre><code> $offer_name= $item['data'][$i]['Offer']['name']; 
  
  echo $offer_name; // the value gets echoed .
  
   add_post_meta($post_id, 'offer_name', $offer_name); // the value of $offer_name doesn't  get stored 
  </code></pre>
  
  <p>case 2 // without json the value get stored..</p>
  
  <pre><code>  $offer_name="My  Name"; 
  
   add_post_meta($post_id, 'offer_name', $offer_name); // the value of $offer_name does get stored 
  </code></pre>
  
  <p>Update 2: if i store the json data in  "{ }"  then the value get stored in WordPress </p>
  
  <pre><code>$offer_name ="{$item['data'][$i]['Offer']['name']}";
  
  
  add_post_meta($post_id, 'offer_name', $offer_name);
  </code></pre>
  
  <p>Thanks in Advance</p>