Hi Rajeash

I think this might be about namespaces and SimpleXML. Does this help?

foreach ($result as $title) {
  $ns_gd = $title->children('http://schemas.google.com/g/2005');
  echo  $ns_gd->attributes()->address;
}

Gavin

On Feb 13, 10:46 am, Rajeash <[email protected]> wrote:
> Hi,
>
> I need to fetch gmail contacts using Oauth2.0 using PHP
>
> $xml=  new SimpleXMLElement($xmlresponse);
> $xml->registerXPathNamespace('gd', 'http://schemas.google.com/g/
> 2005');
> $result = $xml->xpath('//gd:email');
>
> foreach ($result as $title) {
>  echo $title->attributes()->address;
>
> }
>
> in the above code  i am retrieving all email of the contacts.
> Can anyone tell me that how i need to pick all infornation of my
> contact like like
> Firstname
> Lastname
> Phonenumber,
> Email.
>
> As of now it is displaying only email when i am using above code.
> I need a same which should retrieve Email, firstname, lastname and
> phone number.

-- 
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html

Reply via email to