Php analyzes the rss Code Section .? Phpfunctionmy_headlines ($ url) {$ rdfparse_url ($ url); $ fpfsockopen ($ rdf [host], 80, $ errno, $ errstr, 15); if (! $ Fp) {$ contentfontProblema! Font; retur Function my_headlines ($ url ){
$ Rdf = parse_url ($ url );
$ Fp = fsockopen ($ rdf ['host'], 80, $ errno, $ errstr, 15 );
If (! $ Fp ){
$ Content = "Problema! ";
Return;
}
If ($ fp ){
Fputs ($ fp, "GET". $ rdf ['path']. "? ". $ Rdf ['query']." HTTP/1.0 ");
Fputs ($ fp, "HOST:". $ rdf ['host']. "");
$ String = "";
While (! Feof ($ fp )){
$ Pagetext = fgets ($ fp, 300 );
$ String. = chop ($ pagetext );
}
Fputs ($ fp, "Connection: close ");
Fclose ($ fp );
$ Items = explode ("", $ String );
$ Content = "";
For ($ I = 0; $ I <10; $ I ++ ){
$ Link = ereg_replace (".* "," ", $ Items [$ I]);
$ Link = ereg_replace (". * "," ", $ Link );
$ Title2 = ereg_replace (".* "," ", $ Items [$ I]); <br/> $ title2 = ereg_replace (". * "," ", $ Title2 );
If ($ items [$ I] = ""){
$ Content = "";
Return;
} Else {
If (strcmp ($ link, $ title )){
$ Cont = 1;
$ Content. = "$ title2
";
}
}
}
}
Echo "$ content ";
}
My_headlines
?>
Http://www.bkjia.com/PHPjc/631791.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631791.htmlTechArticle? Php function my_headlines ($ url) {$ rdf = parse_url ($ url); $ fp = fsockopen ($ rdf ['host'], 80, $ errno, $ errstr, 15); if (! $ Fp) {$ content = "font class =" content "Problema! /Font "; retur...