Guys help me look at this code, how to run after it is garbled

Source: Internet
Author: User
Everybody help me to see this code, how to run after is garbled?
Everybody help me to see this code, how to run after is garbled?


function My_headlines ($url) {
$RDF = Parse_url ($url);
$fp = Fsockopen ($RDF [host], $errno, $ERRSTR, 15);
if (! $fp) {
$content = "problema!";
Return
}
if ($fp) {
Fputs ($fp, "GET".) $RDF [path]. "? " . $RDF [query]. "http/1.0\r\n");
Fputs ($FP, "HOST:".) $RDF [Host]. "\r\n\r\n");
$string = "";
while (!feof ($fp)) {
$pagetext = fgets ($fp, 300);
$string. = Chop ($pagetext);
}
Fputs ($fp, "connection:close\r\n\r\n");
Fclose ($FP);
$items = Explode ("", $string);
for ($i =0; $i <10; $i + +) {
$link = Ereg_replace (". * "," ", $items [$i]);
$link = Ereg_replace (". * "," ", $link);
$title 2 = ereg_replace (". * <title>"," ", $items [$i]); <br/> $title 2 = ereg_replace ("</title>. * "," ", $title 2);
if ($items [$i] = = "") {
$content = "";
Return
} else {
if (strcmp ($link, $title)) {
$cont = 1;
$content. = "
  • $title 2
  • \ r \ n ";
    }
    }
    }
    }
    echo "$content";
    }
    My_headlines ("Http://news.sohu.com/rss/it.xml");
    ?>

    ------Solution--------------------
    Declare the language type: Utf-8
    ------Solution--------------------
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.