
Accomodations
About Florence

Contacts

FlorenceDirectHotels
Via Cappellini, 18
51016 - Montecatini Terme (PT) - Italy
info@florencedirecthotels.com
http://www.florencedirecthotels.com
$struct = array(); # Funzioni di callback function startElement($parser, $name, $attrs) { global $struct; $tag = array("name"=>$name,"attrs"=>$attrs); array_push($struct,$tag); } function data($parser, $data) { global $struct,$i; if(trim($data)) { $struct[count($struct)-1]['data']=$data; } } function endElement($parser, $name) { global $struct; $struct[count($struct)-2]['child'][] = $struct[count($struct)-1]; array_pop($struct); } # Funzione che parsa il file passatogli nell'argomento e restituisce # una struttura ad albero oggetti-array contenente il documento function parse_file($file) { global $struct; $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "data"); $parse = xml_parse($xml_parser,file_get_contents($file)); if(!$parse) { die("XML parsing error"); xml_parser_free($xml_parser); } return $struct; } ?> $struct1 = array(); # Funzioni di callback function startElement1($parser, $name, $attrs) { global $struct1; $tag = array("name"=>$name,"attrs"=>$attrs); array_push($struct1,$tag); } function data1($parser, $data) { global $struct1,$i; if(trim($data)) { $struct1[count($struct1)-1]['data']=$data; } } function endElement1($parser, $name) { global $struct1; $struct1[count($struct1)-2]['child'][] = $struct1[count($struct1)-1]; array_pop($struct1); } # Funzione che parsa il file passatogli nell'argomento e restituisce # una struttura ad albero oggetti-array contenente il documento function parse_file1($file) { global $struct1; $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement1", "endElement1"); xml_set_character_data_handler($xml_parser, "data1"); $parse = xml_parse($xml_parser,file_get_contents($file)); if(!$parse) { die("XML parsing error"); xml_parser_free($xml_parser); } return $struct1; } ?>

Accomodations
About Florence

Contacts
