Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!empty($rss_feed)) {
- $i = 1;
- foreach ($rss_feed->channel->item as $feed_item) {
- if ($i < 9 ) {
- ?>
- <a href="description.php?feed=<?php echo $i; ?>">
- <div class="post-box">
- <div class="rss-img"><?php echo "<img src='$feed_item->image'/>"; ?></div>
- <br>
- <div class="post-text"><a class="feed_title" href="technology-news-page.php" target="_blank"><?php echo $feed_item->title; ?></a></div>
- <!--<div><?php /*?><?php echo implode(' ', array_slice(explode(' ', $feed_item->description), 0, 14)) . "..."; ?><?php */?></div>-->
- </div>
- </a>
- <?php
- $i++;
- }
- }
- }
- ?>
- technology-news-page.php
- if (isset($_GET['feed'])) {
- $feed = $_GET['feed'];
- $rss_feed = simplexml_load_file("http://feeds2.feedburner.com/Propakistani");
- if (isset($rss_feed->channel->item[$feed])) {
- $feed_item = $rss_feed->channel->item[$feed];
- echo $feed_item->title;
- } else {
- echo 'Feed is not available or has been removed';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement