开发者

Trying to parse/explode xml feed [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Best XML Parser for PHP

What RSS parser should I use in PHP?

I'm trying to extrapolate some data from Godaddy's auction XML feed. It looks like this:

<?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>

what I want to do is get parts of the listings, such as the url, price, etc.

I've tried exploding by /n, but I think this doesnt work because things are on different lines.

Any ideas?

Th开发者_如何转开发anks, Nick


Have you tried SimpleXML or XML Parser, or even XML Reader?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜