我有一個文檔,它的結構如下所示。
有很多<entry>
。我的問題是我怎樣才能輸出每個條目的<uri>
?還有一個問題,我怎樣才能輸出USERNAME
?如何在XML文檔中提取<uri></uri>的內容?
這是我想要得到的用戶名http://search.twitter.com/search.atom?q=yankees
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns:google="http://base.google.com/ns/1.0" xml:lang="en-US" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.w3.org/2005/Atom" xmlns:twitter="http://api.twitter.com/" xmlns:georss="http://www.georss.org/georss">
<entry>
<author>
<name></name>
<uri>http://twitter.com/USERNAME</uri>
</author>
</entry>
文件
[用簡單的XML閱讀Twitter的RSS搜索飼料(可能重複http://stackoverflow.com/questions/1787064/reading-twitters-rss-search- feed-with-simple-xml) – salathe 2012-02-08 18:43:28
請參閱http://php.net/simplexml.examples-basic並將示例修改爲您想要使用的twitter搜索xml。 – salathe 2012-02-08 18:44:15