Hi
I have the following which puts the content of an XML feed into an array:
The array is structured as follows:PHP Code:<?php
require_once('classes/xml2array.php');
function curlURL($url) {
$ch= curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2');
$output = curl_exec($ch);
return $output;
}
$curlResults = curlURL("http://www.a website/75.xml");
$xml = $curlResults;
$converter = new Xml2Array();
$converter->setXml($xml);
$xml_array = $converter->get_array();
?>
Code XML:Array ( [root] => Array ( [feed] => Array ( [version] => Array ( [#text] => 2_1 ) ) [item] => Array ( [0] => Array ( [id] => Array ( [#text] => HE 019 ) [date] => Array ( [#text] => 2009-02-01 21:17:05 ) [ref] => Array ( [#text] => HE 019 ) [price] => Array ( [#text] => 760000
I would like some tailored advice as to how I can output the various values to my page. the example shows only one item there are around 400 items in the feed.
Despite trawling the info about arrays and trying to implement what I have read I cannot seem to get my head around this.
Can somebody please get me started on this.
TIA
Colin







Bookmarks