WordPress XML to Php string

Hi everyone, I am trying to get the value of my wordpress xml.

Here’s my code:

<?php $xmlDecode = simplexml_load_file('xmlfile.xml', 'SimpleXMLElement', LIBXML_NOCDATA);  ?>
<?php foreach ($xmlDecode->channel->item as $data) : ?>
 <td><?php echo $data->title; ?></td>
<?php foreach ($data->postmeta->meta_value as $key => $value) {
<td><?php echo $value ?></td>
 ?>
<?php endforeach; ?>

here’s my xml

<meta_value><![CDATA[a:14:{s:12:"buying_group";s:4:"RONA";s:9:"member_id";s:4:"1385";s:7:"address";s:13:"107 Bruce  ";s:9:"address_2";s:0:"";s:4:"city";s:6:"Dunham";s:8:"province";s:6:"Quebec";s:6:"postal";s:7:"J0E 1M0";s:3:"lat";s:10:"45.1346909";s:3:"lng";s:10:"-72.799976";s:4:"name";s:10:"Guy Daigle";s:5:"phone";s:12:"450-295-2649";s:3:"fax";s:12:"450-295-3522";s:5:"email";s:0:"";s:5:"notes";s:0:"";}]]></meta_value>

I am trying to get the value of meta_value. I don’t know what term I should say but what I want is to get the “buying_group” is equal to “RONA” then “member_id” equal to “1385”

Is there a way to get it? Appreciate any help

Thank you.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.