Php 显示来自XML文件的Twitter配置文件图片

Php 显示来自XML文件的Twitter配置文件图片,php,xml,twitter,Php,Xml,Twitter,目前,我正在显示来自地理编码的推文,以及推文本身、用户名、推文时间和日期。但是现在我试图访问XML中的配置文件图片。我已经访问了链接标签中包含的状态的链接 这是我试图访问的标签 <link type="image/png" href="http://a0.twimg.com/profile_images/1706928570/IMG00474-20111008-1737_normal.jpg" rel="image" > XML文件中的位置是第18行 <feed xmln

目前,我正在显示来自地理编码的推文,以及推文本身、用户名、推文时间和日期。但是现在我试图访问XML中的配置文件图片。我已经访问了链接标签中包含的状态的链接

这是我试图访问的标签

<link type="image/png" href="http://a0.twimg.com/profile_images/1706928570/IMG00474-20111008-1737_normal.jpg" rel="image" >

XML文件中的位置是第18行

<feed xmlns:google="http://base.google.com/ns/1.0" 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" xml:lang="en-US" >
   <id>tag:search.twitter.com,2005:search/</id>
   <link type="text/html" href="http://search.twitter.com/search?q=" rel="alternate" >
   <link type="application/atom+xml" href="http://search.twitter.com/search.atom?q=" rel="self" >
   <title>- Twitter Search</title>
   <link type="application/opensearchdescription+xml" href="http://twitter.com/opensearch.xml" rel="search" >

   <link type="application/atom+xml" href="http://search.twitter.com/search.atom?since_id=170944502142476289&q=&geocode=51.5069999695%2C-0.142489999533%2C10.0mi%22london%22" rel="refresh" >
   <updated>2012-02-18T18:55:19Z</updated>
   <openSearch:itemsPerPage>15</openSearch:itemsPerPage>
   <link type="application/atom+xml" href="http://search.twitter.com/search.atom?page=2&max_id=170944502142476289&q=&geocode=51.5069999695%2C-0.142489999533%2C10.0mi%22london%22" rel="next" >
   <entry>
          <id>tag:search.twitter.com,2005:170944502142476289</id>
          <published>2012-02-18T18:55:19Z</published>
          <link type="text/html" href="http://twitter.com/LondITjobs/statuses/170944502142476289" rel="alternate" >
          <title>Software Development Engineer II - London #job #jobs #hiring #career http://t.co/VsxPdWdT</title>
          <content type="html" >Software Development Engineer II - London #job #jobs #hiring #career http://t.co/VsxPdWdT</content>
          <updated>2012-02-18T18:55:19Z</updated>
          <link type="image/png" href="http://a3.twimg.com/profile_images/1812202768/jr_100_normal.png" rel="image" >
          <twitter:geo>
          <google:location>London</google:location>
          <twitter:metadata>
                 <twitter:result_type>recent</twitter:result_type>
             </twitter:metadata>
          <twitter:source>twitterfeed</twitter:source>
          <twitter:lang>en</twitter:lang>
          <author>
                 <name>LondITjobs (ITjobsLondon)</name>
                 <uri>http://twitter.com/LondITjobs</uri>
             </author>
      </entry> 

标签:search.twitter.com,2005:search/
-推特搜索
2012-02-18T18:55:19Z
15
标签:search.twitter.com,2005:170944502142476289
2012-02-18T18:55:19Z
二级软件开发工程师-伦敦#工作#工作#招聘#职业http://t.co/VsxPdWdT
二级软件开发工程师-伦敦#工作#工作#招聘#职业http://t.co/VsxPdWdT
2012-02-18T18:55:19Z
伦敦
最近的
推特馈送
EN

。.'link->link->attributes()->href./>'.
'$项目->作者->姓名。“
“<强>'$日期。”'.'
; } } ?>
目前,我已经使用XML的入口部分访问了第一个链接标记,我对如何访问图片有点不确定。我曾考虑过使用链接[0],但不知道这是否是一种方法。有什么建议吗


我们终于找到了解决办法

'<img src="http://api.twitter.com/1/users/profile_image/' . $item->author->name .'" width="55" height="55"'. '>' . '</a>' 
'author->name.'width=“55”height=“55”.>'
用户名被解析到URL的末尾,然后超链接回用户的配置文件。所有图片都受到限制以确保一致性

'<img src="http://api.twitter.com/1/users/profile_image/' . $item->author->name .'" width="55" height="55"'. '>' . '</a>'