Created
May 16, 2016 05:44
-
-
Save daipresents/6a1d148680bdead9713fd82efe44950d to your computer and use it in GitHub Desktop.
PHP4でWeb上のRSSを簡単に読み込んでみた
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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