如何检索<ASIN>..</ASIN>
此 xml 的所有值并将它们保存到 php 变量/数组?
我试过$result=$xml->xpath('//ASIN');
了,但这给了我array(0) { }
一个浏览器输出。谢谢您的帮助!我非常感激!
这是我的 xml 文件:
<?xml version="1.0" ?>
<ItemLookupResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2011-08-01">
<OperationRequest>
<RequestId>...</RequestId>
<Arguments>
<Argument Name="region" Value="de"></Argument>
<Argument Name="ItemId" Value="B007ZXLRVQ"></Argument>
<Argument Name="Operation" Value="ItemLookup"></Argument>
<Argument Name="Service" Value="AWSECommerceService"></Argument>
<Argument Name="AWSAccessKeyId" Value="...."></Argument>
<Argument Name="Timestamp" Value="2012-11-27T12:52:41Z"></Argument>
<Argument Name="Signature" Value="...."></Argument>
<Argument Name="ResponseGroup" Value="Similarities"></Argument>
<Argument Name="AssociateTag" Value="..."></Argument>
<Argument Name="Version" Value="2009-10-01"></Argument>
</Arguments>
<RequestProcessingTime>0.0216670000000000</RequestProcessingTime>
</OperationRequest>
<Items>
<Request>
<IsValid>True</IsValid>
<ItemLookupRequest>
<IdType>ASIN</IdType>
<ItemId>B007ZXLRVQ</ItemId>
<ResponseGroup>Similarities</ResponseGroup>
<VariationPage>All</VariationPage>
</ItemLookupRequest>
</Request>
<Item>
<ASIN>B007ZXLRVQ</ASIN>
<SimilarProducts><SimilarProduct><ASIN>B007Y6DS84</ASIN>
<Title>Brita 040 147 Starterpaket Marella Cool, weiß</Title>
</SimilarProduct>
<SimilarProduct>
<ASIN>B0018K7EMI</ASIN>
<Title>Trinkflasche 1,0 Liter für gefiltertes Wasser</Title>
</SimilarProduct>
<SimilarProduct>
<ASIN>B000QG7AJM</ASIN>
<Title>Brita Filterkartuschen Maxtra Pack 4 (lim. Edition)</Title>
</SimilarProduct>
<SimilarProduct>
<ASIN>B001T9N51M</ASIN>
<Title>Brita Filterkartuschen Maxtra Pack 12 (lim. Edition)</Title>
</SimilarProduct>
<SimilarProduct>
<ASIN>B001ET6CNU</ASIN>
<Title>wuta kamille 82158 Herbacin Handcreme + Glyzerin Dose 75 ml, Fünferpack</Title>
</SimilarProduct>
</SimilarProducts>
</Item>
</Items>
</ItemLookupResponse>