我在下面有这段代码来进一步从 XML 中检索产品,我可以访问除商家徽标 URL 之外的任何子项。如果有人可以请告诉我如何访问商家徽标 URL。
foreach ($productsResult->Products->Product as $result) {
echo "<a href=".$result->Offer->Url." target='_blank'><img class='productImg' src=".$result->Offer->Images[0]->Image->Url."/></a>";
echo "<p><b class='price'>£".$result->Offer->Price->Price."</b></p><br>";
echo "<p><img src=".$result->Offer->Merchant[0]->Name->Logo->Url."/></p>"; *// This is where I need help*
echo "<p class='title'>".$result->Offer->Title.".</p><a class='goToStore w3-btn w3-blue' href=".$result->Offer->Url." target='_blank'><b>Visit Store</b></a>";
<Products>
<Product>
<Offer>
<Title></Title>
<Description> </Description>
<Images>
<Image available="true">
<Url></Url>
<Height></Height>
<Width></Width>
</Image>
<Merchant>
<Name></Name>
<Logo>
<Url>The URL I need</Url>
<Width></Width>
<Height></Height>
</Logo>
</Merchant>
谢谢,