Hi there,
I'm a relative newcomer to php, building a site for our company homepage, i'm just wondering if anybody here would know a good resource when it comes to transferring xml files into an array, i assume a multidimesional array would be a good place to start as the xml file has nested elements 3, 4 deep in places. I can't use php DOM as the server doesn't support it, been using

 xml_parser_create();

So far i can specify particular nodes to filter into the array:-

function startElement($parser, $tagname) {

	if ($this->insideitem) {
		$this->tag = $tagname;
	} elseif ($tagname == $this->chosenItem) {
		$this->insideitem = true;
	}
}

function characterData($parser, $data) {

	if ($this->insideitem) {

		//var $thistag;
		if($this->tag != $this->outsidetag){

			$this->taglist[$this->tag] = $data;
			$this->outsidetag = $this->tag;
		}
}

but i want to dynamically represent the whole docmuent in the array and then make calls to the array to generate the html, i'm sure this is possible using multidimensional arrays, i just cant work out how to do it.

    Write a Reply...