/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<ul> <?php if ($rss) { $i = 0; foreach ($rss->channel->item as $item) { if (++$i > 7) { // stop after 7 items break; } } } else { echo "Tumblr is down."; } ?> </ul>
URL: http://marshallim.posterous.com/simplexml-and-php-error-handling-tumblr-rss-e