topical media & game development
mashup-delicious-06-example6-6.php / php
<?php
//this multi-dimensional array will store the XML data
file_name = 'example6-6.xml';
//setup the parser and handlers
parser, "process_start", "process_end");
xml_set_character_data_handler(file = fopen(file_data = fread(parser, file)))
die(xml_error_string(xml_get_error_code(parser)));
}
//clear the parser
xml_parser_free(file_name Raw Array Contents:</h3>";
echo "<pre>";
print_r(parser, attributes)
{
global element_data = array("name"=>attributes);
array_push(element_data);
}
//handle the end of an element
function process_end(name)
{
global xml_data_array[count(xml_data_array[count(xml_data_array);
}
//handle the character data (content) of an element
function process_cdata(cdata)
{
global i;
if(trim(xml_data_array[count(cdata;
}
}
?>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.