解析从Google DATA API获取的数据
我正在开发一个 Google API 来获取我网站上用户的联系人,并且我使用这样的方法获得了结果,但我希望将联系人从整个块中取出。
我只是想知道,如何从这里解析值?
这是我收到的数据:-
[0]=>;数组(7){ [“id”]=> 数组(1){ [“$t”]=> 字符串(83) “http://www.google.com/m8/feeds/contacts/atiprashant%40gmail.com/base/1213ed0accdb4e” } [“已更新”]=> 数组(1){ [“$t”]=> 字符串(24)“2011-07-16T06:04:00.610Z” } [“类别”]=> 数组(1){ [0] => 数组(2){ [“方案”]=> 字符串(37)“http://schemas.google.com/g/2005#kind” [“术语”] => 字符串(46)“http://schemas.google.com/contact/2008#contact” } } [“标题”] => 数组(2){ [“类型”]=> 字符串(4)“文本” [“$t”]=> 字符串(22)“ajay kumar yadav RKite” } [“链接”]=> 数组(4){ [0] => 数组(3){ [“rel”]=> 字符串(54) “http://schemas.google.com/contacts/2008/rel#edit-photo” [“类型”]=> 字符串(7)“图像/” [“href”]=> 字符串(106) “https://www.google.com/m8/feeds/photos/media/atiprashant%40gmail.com/1213ed0accdb4e/18unp7AvcGYQW42p1HfLVA” } [1]=> 数组(3){ [“rel”]=> 字符串(49)“http://schemas.google.com/contacts/2008/rel#photo” [“类型”]=> 字符串(7)“图像/” [“href”]=> 字符串(83) “https://www.google.com/m8/feeds/photos/media/atiprashant%40gmail.com/1213ed0accdb4e” } [2]=> 数组(3){ [“rel”]=> 字符串(4)“自我” [“类型”]=> 字符串(20)“应用程序/atom+xml” [“href”]=> 字符串(84) “https://www.google.com/m8/feeds/contacts/atiprashant%40gmail.com/full/1213ed0accdb4e” } [3]=> 数组(3){ [“rel”]=> 字符串(4)“编辑” [“类型”]=> 字符串(20)“应用程序/atom+xml” [“href”]=> 字符串(101) “https://www.google.com/m8/feeds/contacts/atiprashant%40gmail.com/full/1213ed0accdb4e/1310796240610001” } } [“gd$email”]=> 数组(1){ [0] => 数组(3){ [“rel”]=> 字符串(38)“http://schemas.google.com/g/2005#other” [“地址”]=> string(21) "[电子邮件受保护]" [“主要”] => 字符串(4)“真” } } [“gContact$groupMembershipInfo”]=> 数组(1){ [0] => 数组(2){ [“已删除”]=> 字符串(5)“假” [“href”]=> 字符串(83) “http://www.google.com/m8/feeds/groups/atiprashant%40gmail.com/base/3ba9061f0dded52e” } } }
I am working on a Google API to obtain the contacts of users at my website, and I obtained a result using like this, but I wish wish to have the contacts out of the whole chunk.
I just wanna know , how can I parse values from here ??
Here is the data i received :-
[0]=> array(7) { ["id"]=> array(1) { ["$t"]=> string(83) "http://www.google.com/m8/feeds/contacts/atiprashant%40gmail.com/base/1213ed0accdb4e" } ["updated"]=> array(1) { ["$t"]=> string(24) "2011-07-16T06:04:00.610Z" } ["category"]=> array(1) { [0]=> array(2) { ["scheme"]=> string(37) "http://schemas.google.com/g/2005#kind" ["term"]=> string(46) "http://schemas.google.com/contact/2008#contact" } } ["title"]=> array(2) { ["type"]=> string(4) "text" ["$t"]=> string(22) "ajay kumar yadav RKite" } ["link"]=> array(4) { [0]=> array(3) { ["rel"]=> string(54) "http://schemas.google.com/contacts/2008/rel#edit-photo" ["type"]=> string(7) "image/" ["href"]=> string(106) "https://www.google.com/m8/feeds/photos/media/atiprashant%40gmail.com/1213ed0accdb4e/18unp7AvcGYQW42p1HfLVA" } [1]=> array(3) { ["rel"]=> string(49) "http://schemas.google.com/contacts/2008/rel#photo" ["type"]=> string(7) "image/" ["href"]=> string(83) "https://www.google.com/m8/feeds/photos/media/atiprashant%40gmail.com/1213ed0accdb4e" } [2]=> array(3) { ["rel"]=> string(4) "self" ["type"]=> string(20) "application/atom+xml" ["href"]=> string(84) "https://www.google.com/m8/feeds/contacts/atiprashant%40gmail.com/full/1213ed0accdb4e" } [3]=> array(3) { ["rel"]=> string(4) "edit" ["type"]=> string(20) "application/atom+xml" ["href"]=> string(101) "https://www.google.com/m8/feeds/contacts/atiprashant%40gmail.com/full/1213ed0accdb4e/1310796240610001" } } ["gd$email"]=> array(1) { [0]=> array(3) { ["rel"]=> string(38) "http://schemas.google.com/g/2005#other" ["address"]=> string(21) "[email protected]" ["primary"]=> string(4) "true" } } ["gContact$groupMembershipInfo"]=> array(1) { [0]=> array(2) { ["deleted"]=> string(5) "false" ["href"]=> string(83) "http://www.google.com/m8/feeds/groups/atiprashant%40gmail.com/base/3ba9061f0dded52e" } } }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不一定需要自己解析它。如果 Google 数据库适用于您的环境,您可以只使用它。例如,它具有 Java、.NET、PHP、GWT 的绑定 (gwt-gdata )、Python 等。请查看以下内容:
You don't necessarily have to parse it yourself. You can just use the Google Data library if it is available for your environment. For instance it has bindings for Java, .NET, PHP, GWT (gwt-gdata), Python, etc. Look at the following: