"; $good_counter++; } else { //echo "bad
"; $bad_counter++; } } } $status = count($_BLOGROLL); $_BLOGROLL = null; echo "added $good_counter, didn't add $bad_counter"; return $status; } function parse_opml($file) { $fp = @fopen($file, 'rB'); if (! $fp) { return false; } $opml = fread($fp, 1000000); $xp = xml_parser_create(); xml_set_element_handler($xp, '_xml_startElement', '_xml_endElement'); xml_parse($xp, $opml, true); xml_parser_free($xp); return true; } function _xml_startElement($xp, $element, $attr) { global $_BLOGROLL; if (strcasecmp('outline', $element)) { return; } $_BLOGROLL[$attr['TITLE']] = $attr; } function _xml_endElement($xp, $element) { return; } ?>