Trying to truncate the results below so that I only read about 5 lines of imported RSS feed .....how can I accomplish this? Thanks
<?
// function that starts code element...
function endElement($parser, $tagName)
{
global $insideitem, $tag, $title, $description, $link, $pubDate;
if ($tagName == "ITEM") {
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
$text = strtr ($description, $trans_tbl);
echo "<font face=\"Arial\" size=\"2\"><a href='news/index.php?feed=1'><b>$title</b></a> | <a href='news/index.php?feed=1'>more..</a></font><br>";
$title = $description = $link = $pubDate = $insideitem = false;
}
}
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
$fp = fopen($backend, r);
while ($data = fread($fp, 4096)) {
xml_parse($xml_parser, $data, feof($fp))
or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
fclose($fp);
xml_parser_free($xml_parser);
?>