试图解析/爆炸xml feed

时间:2011-09-13 06:47:19

标签: php xml explode

  

可能重复:
  Best XML Parser for PHP
  What RSS parser should I use in PHP?

我正在尝试从Godaddy的拍卖XML Feed中推断出一些数据。它看起来像这样:

<?xml version='1.0' ?><!-- pageok --><rss version='2.0' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:admin='http://webns.net/mvcb/' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:slash='http://purl.org/rss/1.0/modules/slash/' xmlns:wfw='http://wellformedweb.org/CommentAPI/' xmlns:content='http://purl.org/rss/1.0/modules/content/'><channel><title>Go Daddy Auctions - All Auctions Ending Today</title><link>https://auctions.godaddy.com/trpHome.aspx?isc=rssTD01</link><description>All Auctions ending today at Go Daddy Auctions</description><language>en-us</language><copyright>Copyright 2011</copyright><lastBuildDate>Mon, 12 Sep 2011 14:00:42 GMT</lastBuildDate><ttl>60</ttl><image><url>http://img1.wsimg.com/fos/img/img_logo_65x65_white.jpg</url><title>Go Daddy Auctions - auctions.godaddy.com</title><link>https://auctions.godaddy.com/trpHome.aspx?isc=rssTD01</link></image><item><title>Auctions Ending Today</title><link><![CDATA[https://auctions.godaddy.com/trpSearchResults.aspx?ra=4236071220110900&isc=rssTD01]]></link><description><![CDATA[The domains people want are going fast at auctions.godaddy.com]]></description><guid><![CDATA[https://auctions.godaddy.com/trpSearchResults.aspx?ra=4236071220110900&isc=rssTD01]]></guid></item>
<item><title>NEXTKILL.COM</title><link><![CDATA[https://auctions.godaddy.com/trpItemListing.aspx?miid=56665411&isc=rssTD01]]></link><description><![CDATA[Auction Type: Bid, Auction End Time: 09/12/2011 06:00 AM (PDT), Asking Price/Current Bid: $60, Number of Bids: 0, Domain Age: 0, Description: , Traffic: 3983, Valuation: $0, IsAdult: false]]></description><guid><![CDATA[https://auctions.godaddy.com/trpItemListing.aspx?miid=56665411]]></guid></item>
<item><title>JEANLEGGINGS.COM</title><link><![CDATA[https://auctions.godaddy.com/trpItemListing.aspx?miid=55617299&isc=rssTD01]]></link><description><![CDATA[Auction Type: Bid, Auction End Time: 09/12/2011 07:45 AM (PDT), Asking Price/Current Bid: $50, Number of Bids: 1, Domain Age: 0, Description: , Traffic: 0, Valuation: $0, IsAdult: false]]></description><guid><![CDATA[https://auctions.godaddy.com/trpItemListing.aspx?miid=55617299]]></guid></item>

我想要做的是获取部分商品,例如网址,价格等。

我尝试用/ n爆炸,但我认为这不起作用,因为事情在不同的行上。

有什么想法吗?

谢谢, 尼克

1 个答案:

答案 0 :(得分:0)

您是否尝试过SimpleXMLXML Parser,甚至是XML Reader