Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save daipresents/6a1d148680bdead9713fd82efe44950d to your computer and use it in GitHub Desktop.

Select an option

Save daipresents/6a1d148680bdead9713fd82efe44950d to your computer and use it in GitHub Desktop.
PHP4でWeb上のRSSを簡単に読み込んでみた
<?php
include('xml.php');
$RSS_HOST = 'http://daipresents.com/rss.xml';
$xml_data = file_get_contents($RSS_HOST);
//$xml = mb_convert_encoding(file_get_contents($RSS_HOST), 'UTF-8′, 'auto');
$data = XML_unserialize($xml_data);
echo "<ul>";
foreach($data['rss']['channel']['item'] as $entry){
echo '<li><a href="' . $entry['link'] . '">' . $entry['title'] . '</a>(' . $entry['pubDate'] . ')</li>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment