Hi Gavin,

Still i am not getting the result.

I am using the below code to fetch the contacts of Gmail, where it
returns *only
Email* of the user
$result = $xml->xpath('//gd:email');

I want to fetch Email, FirstName, LastName, PhoneNumber,OrganizationName,
PostalAddress all simultanously.
May i know the Exactly how to fetch all the above information of the my all
contacts.



On Sat, Feb 18, 2012 at 9:20 PM, Gavin Johnson <[email protected]> wrote:

> 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
>



-- 
Rajeash
9962566123

-- 
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