Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 771893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:43:32+00:00 2026-05-14T18:43:32+00:00

I am using PHP’s SimpleXML to get some values out of the following XML;

  • 0

I am using PHP’s SimpleXML to get some values out of the following XML;

- <entry>
  <id>http://www.google.com/m8/feeds/contacts/email_address%40gmail.com/base/0</id> 
  <updated>2010-01-14T22:06:26.565Z</updated> 
  <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact" /> 
  <title type="text">Customer Name</title> 
  <link rel="http://schemas.google.com/contacts/2008/rel#edit-photo" type="image/*" href="http://www.google.com/m8/feeds/photos/media/email_address%40gmail.com/0/34h5jh34j5kj3444" /> 
  <link rel="self" type="application/atom+xml" href="http://www.google.com/m8/feeds/contacts/email_address%40gmail.com/full/0" /> 
  <link rel="edit" type="application/atom+xml" href="http://www.google.com/m8/feeds/contacts/email_address%40gmail.com/full/0/5555" /> 
  <gd:email rel="http://schemas.google.com/g/2005#other" address="customer@gmail.com" primary="true" /> 
  </entry>

I can get the title with:

$xml = new SimpleXMLElement($response_h1);

foreach ($xml->entry as $entry) {
   echo $entry->title, '<br />';
}

But how to get the address=”customer@gmail.com” property?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:43:33+00:00Added an answer on May 14, 2026 at 6:43 pm

    Your namespace is invalid. If no namespace, you should be able to fetch the address like this,

    $email = (string)$xml->email['address'];
    

    There are some bugs in SimpleXML. The elements work with member syntax “->” but the attributes are only accessible using array syntax “[]”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using php or javascript or ajax how to replace specific link to * http://www.google.com/
Using PHP I'm trying to download/save the following image: http://www.bobshop.nl/catalog/product_image.php?size=detail&id=42428 When you load this
Using PHP and MySQL I'm trying to get all the distinct values out the
Using php I am trying to get some data from a .csv file which
Using PHP Regular Expression I want to extract some value from code <?xml version=1.0
Using PHP 5.3+ and having something equal to the following I get the output
Using PHP I echo out table rows in a loop like this: <?php /*
Using PHP's ReflectionClass. Is this possible? I want to get a list of methods
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
Using PHP (other languages, using common built-ins are welcome), how can I get a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.