Jump to content

Recommended Posts

Hey PHP Gurus

I desperately need some help with PHP and XML.

This is my dilema;
I have a php script that reads and xml feed and parses it to html on my site, this works very well and I am quite happy with it. This php script has a $counter in it which, at this time, displays the latest 50 articles. I need to add an archive link and I was wondering if there is anyway that I can either replace or edit the following;
[code=php:0]
for ($counter = 1; $counter <= 50; $counter++;)
[/code]
to show the rest of the articles after the first 50 - so if there is a total of 1000 articles, only display the articles AFTER the first 50 (the last 950 articles).

I would appreciate the help.

Regards
S
Link to comment
https://forums.phpfreaks.com/topic/35486-rss-feeds/
Share on other sites

That shouldn't be a problem.  It all depends on how you are parsing the xml.

If you are using $counter as some kind of index into the xml, then you can just do

[code]
for ($counter = 51; $counter <= 1000; $counter++)
[/code]

On the other hand, if $counter is just loop-counter, you'd might need to rethink a little bit.  What are you using to parse the rss?  Using a library such as [url=http://magpierss.sourceforge.net/]MagpieRSS[/url] would probably make this quite trivial.
Link to comment
https://forums.phpfreaks.com/topic/35486-rss-feeds/#findComment-167914
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.