Last active
June 25, 2016 12:22
-
-
Save yasuken1990/da334fa982d7233fa1c3b94bc1c78b38 to your computer and use it in GitHub Desktop.
FC2ブログ記事をRSS取得する。
This file contains 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 | |
// まずは、ドキュメントを読みましょう | |
// http://help.fc2.com/blog/manual/Home/rss.html | |
function getRss() { | |
$rss_url = "http://hogehoge.fc2/?xml"; | |
$rss_data = simplexml_load_file($rss_url,'SimpleXMLElement', LIBXML_NOCDATA); | |
foreach($rss_data as $key => $item) { | |
if ($key == 'channel') { | |
continue; | |
} | |
print_r($item); | |
print_r($item->children('dc',true)); | |
} | |
} | |
getRss(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment