/ Published in: PHP
URL: http://marshallim.posterous.com/simplexml-and-php-error-handling-tumblr-rss-e
Expand |
Embed | Plain Text
<ul> <?php $rss = @simplexml_load_file('http://thedailywhat.tumblr.com/rss'); if ($rss) { $i = 0; foreach ($rss->channel->item as $item) { if (++$i > 7) { // stop after 7 items break; } } } else { echo "Tumblr is down."; } ?> </ul>
You need to login to post a comment.
