如何使用 php 解析 google contact feed(xml 或 json)
我正在尝试使用 php 解析 google 联系人提要,下面是我从 google 获得的 xml 提要的示例,
<entry>
<id>http://www.google.com/m8/feeds/contacts/sample%40gmail.com/base/63a9d180dd7f506</id>
<updated>2010-11-23T10:00:40.848Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact'/>
<title type='text'>@@@@@@this is the sample title i need to get@@@@@</title>
<link rel='http://schemas.google.com/contacts/2008/rel#edit-photo' type='image/*' href='@@@@@this is the link i need@@@@@'/>
<link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/sample40gmail.com/full/680dd7f506'/>
<link rel='edit' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/sample%40gmail.com/full/0dd7f506/12940848000'/>
<gd:email rel='http://schemas.google.com/g/2005#other' address='@@@@@@@@here is the address that i need to get@@@@@@@' primary='true'/>
</entry>
如何解析我使用 php 标记的那些信息?
I'm trying to parse the google contact feed using php, below is the example of the xml feed that i get from google
<entry>
<id>http://www.google.com/m8/feeds/contacts/sample%40gmail.com/base/63a9d180dd7f506</id>
<updated>2010-11-23T10:00:40.848Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact'/>
<title type='text'>@@@@@@this is the sample title i need to get@@@@@</title>
<link rel='http://schemas.google.com/contacts/2008/rel#edit-photo' type='image/*' href='@@@@@this is the link i need@@@@@'/>
<link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/sample40gmail.com/full/680dd7f506'/>
<link rel='edit' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/sample%40gmail.com/full/0dd7f506/12940848000'/>
<gd:email rel='http://schemas.google.com/g/2005#other' address='@@@@@@@@here is the address that i need to get@@@@@@@' primary='true'/>
</entry>
how to parse out those information that i have marked using php?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将结果转换为Json..(方便解析)
使用参数“alt=json”调用API,您将得到Json格式的结果..
Convert the result into Json ..(For easy parsing )
Call the API with the parameter "alt=json" You will get results in Json format ..