I've got a question. My XML document has 3 kind of category's, and my script that is parsing the XML collects always the top one. But that is not what I want, I want to collect the "/live" mount category. But when the "/live" category isn't availible, I want to fetch the "/autodj" category. How can I get this together?
Question
ShadowBooth
Hi there!
I've got a question. My XML document has 3 kind of category's, and my script that is parsing the XML collects always the top one. But that is not what I want, I want to collect the "/live" mount category. But when the "/live" category isn't availible, I want to fetch the "/autodj" category. How can I get this together?
function openstats() { $fp = @fopen("http://admin:".$this->passwd."@".$this->host.":".$this->port."/admin/stats", "r"); if (!$fp) { $this->_error = "$errstr ($errno)"; return(0); } else { while (!feof($fp)) { $this->_xml .= fgets($fp, 512); } fclose($fp); if(!isset($this->_xml)) { $this->_error = "Bad login"; return(0); } $xmlparser = xml_parser_create(); if (!xml_parse_into_struct($xmlparser, $this->_xml, $this->_values, $this->_indexes)) { $this->_error = "Unparsable XML"; return(0); } xml_parser_free($xmlparser); return(1); } }Link to comment
Share on other sites
1 answer to this question
Recommended Posts