Welcome
News  
"); $rss_channel[$main][$item_counter][$currently_writing] = $data; } break; } } } $sources = array("http://rss.news.yahoo.com/rss/tech"); //, "http://z.about.com/6/g/casinogambling/b/index.xml"); $numloops = count($sources); for($l=0;$l<$numloops;$l++) { $file = $sources[$l]; $rss_channel = array(); $currently_writing = ""; $main = ""; $item_counter = 0; $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); if (!($fp = fopen($file, "r"))) { die("could not open XML input"); } while ($data = fread($fp, 4096)) { if (!xml_parse($xml_parser, $data, feof($fp))) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } } xml_parser_free($xml_parser); // output as HTML if (isset($rss_channel["ITEMS"])) { if (count($rss_channel["ITEMS"]) > 0) { for($i = 0;$i < 10;$i++) { $link = mysql_escape_string($rss_channel["ITEMS"][$i]["LINK"]); $title = $rss_channel["ITEMS"][$i]["TITLE"]; $desc = mysql_escape_string($rss_channel["ITEMS"][$i]["DESCRIPTION"]); $desc = str_replace("&#nbsp;", "", $desc); $date = $rss_channel["ITEMS"][$i]["PUBDATE"]; $date = date("Y-m-d H:i:s",strtotime($date)); $date = mysql_escape_string($date); $cat = mysql_escape_string($categories[$l]); echo '
 
'.$title.'
'.stripslashes($desc).'
Read More...
'; } } } } ?>