Home

 Features

 Check my file

 Download

 Example

 Testing

 Sponsors

 Documentation

 Copyright

 Bug Tracker

method="POST">

Select a predefined style:

xml_obj = xml_parser_create(); xml_set_object($this->xml_obj,$this); xml_set_character_data_handler($this->xml_obj, 'dataHandler'); xml_set_element_handler($this->xml_obj, "startHandler", "endHandler"); } function parse($path){ if (!($fp = fopen($path, "r"))) { die("Cannot open XML data file: $path"); return false; } while ($data = fread($fp, 4096)) { if (!xml_parse($this->xml_obj, $data, feof($fp))) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($this->xml_obj)), xml_get_current_line_number($this->xml_obj))); xml_parser_free($this->xml_obj); } } return true; } function startHandler($parser, $name, $attribs){ $_content = array(); $_content['attrs'] = $name; array_push($this->output, $_content); } function dataHandler($parser, $data){ if($data!="\n") { $_output_idx = count($this->output) - 1; // echo $data."
"; $this->output[$_output_idx]['content'] = $data; } } function endHandler($parser, $name){ } } $p =& new xmlParser(); $p->parse($currentfile); $a = $p->output; for($i=1;$i".ucfirst(strtolower($a[$i]['attrs']))." : ".$a[$i]['content']."
"; } ?>

Check this file: