이베이 RSS 피드에서 항목을 추출하는 코드를 사용하고 있는데 유일한 문제는 하나의 항목 만 추출한다는 것입니다.simplexml_load_file을 사용하여 rss 피드의 전체 목록을 추출하십시오.
나는이 사이트가 for each
이기 때문에 의심 스럽지만이 사이트 전체를 검색 한 후에 해결책을 찾지 못했습니다. 피드 URL은 8 개의 항목 (entriesPerPage = 8)을 출력하며 피드에 액세스하면 전체 xml 코드가 있지만 파서는 하나의 항목 만 가져옵니다.
<?php
$feedurl = "http://rest.ebay.com/epn/v1/find/item.rss?keyword=%28jewelry%2Ccraft%2Cclothing%2Cshoes%2Cdiy%29&sortOrder=BestMatch&programid=1&campaignid=5337945426&toolid=10039&listingType1=All&lgeo=1&topRatedSeller=true&hideDuplicateItems=true&entriesPerPage=8&feedType=rss";
$rss = simplexml_load_file($feedurl);
foreach ($rss->channel->item as $item) {
$link = $item->link;
$title = $item->title;
$description = $item->description;
}
?>
<div class="mainproductebayfloatright-bottom">
<div class="aroundebay">
<?
print "<div class=\"titleebay\">" . $title . "</div>";
print $description;
?>
</div>
</div>
?>
한 항목을 반복하고 있기 때문에? $ rss-> channel-> item – blur0224
하지만'foreach' 이후로, 그냥 하나가 아닌 페이지의 각 항목을 가져야하지 않습니까? – User325313