I have an xml feed from Google Contacts API, but I have trouble reading <gd: tags.
$xml = simplexml_load_string($google_contacts);
This reads every elements except the <gd: tags, which contains e-mail information.
What’s the best thing to do?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Update: If you’re using name-spaces and xpath, you might need to register them first in SimpleXML.
If you have problems to access an element, try to enclose it within
{}angel brackets, this probably helps:$xml->{gd:...}.SimpleXML has no/limited support for XML-Namespaces if I remember correctly. DomDocument has, so take it instead.
For a first start:
Or use DomDocument for the part that is difficult to do in SimpleXML only: