tganny Posted November 26, 2009 Share Posted November 26, 2009 Hi, I'm trying to display products from two xml feeds, but i'm having a problem with the number of returned results. The variable $max will return a given number of products. For example, if i want to list 5 products then it will show 10 (5 from the first and another 5 from the second feed). My question would be how to mashup these two variables/feeds, so when i request 5 products to display those 5 and not double it. Here is the two feeds : $url = "http://feed.linksynergy.com/productsearch?&keyword=$keywords&MaxResults=$max"; $url = "http://pf.tradedoubler.com/pf/pf?&keyword=$keywords&maxResults=$max"; and i'm parsing them in: $result .='<div><a href=\"$producturl\">$producttitle</a><br />$productprice</div>'; Link to comment https://forums.phpfreaks.com/topic/183054-merge-two-xml-feed-results-into-one/ Share on other sites More sharing options...
Virvo Posted November 26, 2009 Share Posted November 26, 2009 Instead of creating a long string... try adding each one into an array, then use array_unique() on the array, then use join('', $my_array) to generate the string from the array. Link to comment https://forums.phpfreaks.com/topic/183054-merge-two-xml-feed-results-into-one/#findComment-966100 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.