所以我从谷歌获得了以下混乱的 XML 形式的联系数据:
<entry gd:etag='"Q3Y4fDVSLyt7I2A9WhJXFEkDTgY."'><id>http://www.google.com/m8/feeds/contacts/email/base/24fc18e00ee1c72e</id><updated>2012-08-08T18:18:42.834Z</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-08-08T18:18:42.834Z</app:edited><category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact'/><title>Person 1</title><link rel='http://schemas.google.com/contacts/2008/rel#photo' type='image/*' href='https://www.google.com/m8/feeds/photos/media/email/24fc18e00ee1c72e'/><link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/email/full/24fc18e00ee1c72e'/><link rel='edit' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/email/full/24fc18e00ee1c72e'/><gd:name><gd:fullName>Person 1</gd:fullName><gd:givenName>Person</gd:givenName><gd:familyName>1</gd:familyName></gd:name><gd:email rel='http://schemas.google.com/g/2005#home' address='person1@person.com' primary='true'/><gContact:groupMembershipInfo deleted='false' href='http://www.google.com/m8/feeds/groups/email/base/6'/></entry><entry gd:etag='"R30zcTVSLyt7I2A9WhJXFEkDTgc."'><id>http://www.google.com/m8/feeds/contacts/email/base/2c7cd0de89c805cc</id><updated>2012-08-08T18:18:56.389Z</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2012-08-08T18:18:56.389Z</app:edited><category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact'/><title>Person 2</title><link rel='http://schemas.google.com/contacts/2008/rel#photo' type='image/*' href='https://www.google.com/m8/feeds/photos/media/email/2c7cd0de89c805cc'/><link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/email/full/2c7cd0de89c805cc'/><link rel='edit' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/email/full/2c7cd0de89c805cc'/><gd:name><gd:fullName>Person 2</gd:fullName><gd:givenName>Person</gd:givenName><gd:familyName>2</gd:familyName></gd:name><gd:email rel='http://schemas.google.com/g/2005#home' address='person2@person.com' primary='true'/><gContact:groupMembershipInfo deleted='false' href='http://www.google.com/m8/feeds/groups/email/base/6'/></entry>
我将如何使用domdocument在 PHP 中解析这个 XML 以返回一个不错的数组,其中每个条目都包含人的头衔、姓名和电子邮件?
我不知道在这种情况下哪些 domdocument 方法适合使用。