Hello,
I am using curl with it's code like this:
<?php
$urls = 'http://www.a-url.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $urls);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "xml=".urlencode($xml_posts));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close'));
$result=curl_exec($ch);
var_dump($result);
$data = XML_unserialize($result);
echo ($data);
?>
and using the XML Parse by:
When i echo $data and $result i can see them on the front end and the xml in the source code once i view it.
How do i add a SimpleXML to this as i want to get some of the values from the xml file displayed in a array with a number of rows. Does this mean getting rid of the XMLParser function file and using a SimpleXML function file. Can i not use both?
When i try to use the SimpleXML functions, i'm clueless in how to get it's data from the xml $results. The XML is the source can be shown like this with me only showing one line:
<Result>
<Info>
<Details>
<Type>
<Who>
<Name key="1">This is Me</Name>
<Number1 key="2">18.93</Number1>
<Number2 key="2">20.01</Number2>
<Number3 key="2">15.21</Number3>
</Who>
</Type>
</Details>
</Info>
</Result>
Can somebody please help me with this ? I need to getthis sorted !!