shainh Posted January 24, 2007 Share Posted January 24, 2007 Hey PHP GurusI 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.RegardsS Quote Link to comment https://forums.phpfreaks.com/topic/35486-rss-feeds/ Share on other sites More sharing options...
bqallover Posted January 24, 2007 Share Posted January 24, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/35486-rss-feeds/#findComment-167914 Share on other sites More sharing options...
shainh Posted January 24, 2007 Author Share Posted January 24, 2007 YOU SO TOTALLY ROCK!!!!!!I am not too clued up with PHP yet, still a lot to learn and I had no idea the solution would be that simple.Thank you SO much!!! Quote Link to comment https://forums.phpfreaks.com/topic/35486-rss-feeds/#findComment-167917 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.