title: Need a function for wp all export to unserialize data of a specific field
body: <p>Ι need a function to unserialize  data of a specific field to export to XML File.</p>
  <p>My serialize field is</p>
  <pre><code>&lt;B2B_Sale_price&gt;&lt;![CDATA[a:1:{i:6704;a:2:{s:13:&quot;regular_price&quot;;s:8:&quot;17.33871&quot;;s:10:&quot;sale_price&quot;;s:5:&quot;13.77&quot;;}}]]&gt;&lt;/B2B_Sale_price&gt;
  </code></pre>
  <p>and i'd like to export only the sale_price.</p>
  <p>This function works perfect for csv export</p>
  <pre><code>function data_deserialize_csv($value){$output = '';$data = unserialize($value);print_r($data);$data = reset($data);return $data['sale_price'];}
  </code></pre>
  <p>But for xml return an error
  PHP Error: reset() expects parameter 1 to be array, bool given on line 15 of the Functions Editor</p>