title: Extract data from serialized array and output into PHP
body: <p>I have this:</p>
  
  <pre><code>            case 'Bulk Discount':
              $postMeta = get_post_meta($product-&gt;ID, 'o-discount');
              echo $postMeta[0];
              break;
  </code></pre>
  
  <p>Where 'o-discount' is a post_meta which returns:</p>
  
  <pre><code>'a:4:{s:6:"enable";s:1:"1";s:4:"type";s:10:"percentage";s:10:"rules-type";s:9:"intervals";s:5:"rules";a:1:{i:0;a:3:{s:3:"min";s:1:"3";s:3:"max";s:0:"";s:8:"discount";s:1:"5";}}}'
  </code></pre>
  
  <p>I would like to echo data out of the serialized array so I can display it.</p>
  
  <p>UPDATE:</p>
  
  <p>I have tried to use unserialize with my array above but it does not returns any results. When I use the example I found below, it returns the "Manufactured in" - "Canada" result.</p>
  
  <pre><code>$mydata = 'a:5:{s:9:"engine_id";a:1:
  {i:0;s:9:"300000225";}s:15:"transmission_id";a:1:
  {i:0;s:6:"257691";}s:5:"plant";a:1:{i:0;s:23:"Oshawa, Ontario, 
  Canada";}s:15:"Manufactured in";a:1:{i:0;s:6:"CANADA";}s:22:"Production 
  Seq. Number";a:1:{i:0;s:6:"151411";}}';
  $mydata = unserialize($mydata);
  echo $mydata['Manufactured in'][0];
  </code></pre>