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 5957301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:22:53+00:00 2026-05-22T18:22:53+00:00

Here is a snippet of the xml, it is in a format I have

  • 0

Here is a snippet of the xml, it is in a format I have never seen and for the life of me I can’t figure out how to parse it into something that would actually look decent on a website. Here is the xml. It is a result of a search query on the shopping.com api.

object(SimpleXMLElement)#14 (11) {
  ["@attributes"]=>
  array(1) {
    ["id"]=>
    string(9) "101677489"
  }
  ["name"]=>
  string(26) "Nikon D3100 Digital Camera"
  ["shortDescription"]=>
  string(87) "14.2 Megapixel, SLR Camera, 3 in. LCD Screen, With High Definition Video, Weight: 1 lb."
  ["fullDescription"]=>
  string(829) "The Nikon D3100 digital SLR camera speaks to the growing ranks of enthusiastic D-SLR users and aspiring photographers by providing an easy-to-use and affordable entrance to the world of Nikon D-SLR’s. The 14.2-megapixel D3100 has powerful features, such as the enhanced Guide Mode that makes it easy to unleash creative potential and capture memories with still images and full HD video. Like having a personal photo tutor at your fingertips, this unique feature provides a simple graphical interface on the camera’s LCD that guides users by suggesting and/or adjusting camera settings to achieve the desired end result images. The D3100 is also the world’s first D-SLR to introduce full time auto focus (AF) in Live View and D-Movie mode to effortlessly achieve the critical focus needed when shooting Full HD 1080p video."
  ["images"]=>
  object(SimpleXMLElement)#4 (1) {
    ["image"]=>
    array(5) {
      [0]=>
      object(SimpleXMLElement)#13 (2) {
        ["@attributes"]=>
        array(3) {
          ["available"]=>
          string(4) "true"
          ["height"]=>
          string(3) "100"
          ["width"]=>
          string(3) "100"
        }
        ["sourceURL"]=>
        string(131) "http://di1.shopping.com/images/pi/93/bc/04/101677489-100x100-0-0.jpg?p=p2.6566ad68b022f6260efc&a=2&c=1&l=7000610&t=110528211343&r=2"
      }
      [1]=>
      object(SimpleXMLElement)#5 (2) {
        ["@attributes"]=>
        array(3) {
          ["available"]=>
          string(4) "true"
          ["height"]=>
          string(3) "200"
          ["width"]=>
          string(3) "200"
        }
        ["sourceURL"]=>
        string(131) "http://di1.shopping.com/images/pi/93/bc/04/101677489-200x200-0-0.jpg?p=p2.6566ad68b022f6260efc&a=2&c=1&l=7000610&t=110528211343&r=2"
      }
      [2]=>
      object(SimpleXMLElement)#12 (2) {
        ["@attributes"]=>
        array(3) {
          ["available"]=>
          string(4) "true"
          ["height"]=>
          string(3) "300"
          ["width"]=>
          string(3) "300"
        }
        ["sourceURL"]=>
        string(131) "http://di1.shopping.com/images/pi/93/bc/04/101677489-300x300-0-0.jpg?p=p2.6566ad68b022f6260efc&a=2&c=1&l=7000610&t=110528211343&r=2"
      }
      [3]=>
      object(SimpleXMLElement)#11 (2) {
        ["@attributes"]=>
        array(3) {
          ["available"]=>
          string(4) "true"
          ["height"]=>
          string(3) "400"
          ["width"]=>
          string(3) "400"
        }
        ["sourceURL"]=>
        string(131) "http://di1.shopping.com/images/pi/93/bc/04/101677489-400x400-0-0.jpg?p=p2.6566ad68b022f6260efc&a=2&c=1&l=7000610&t=110528211343&r=2"
      }
      [4]=>
      object(SimpleXMLElement)#10 (2) {
        ["@attributes"]=>
        array(3) {
          ["available"]=>
          string(4) "true"
          ["height"]=>
          string(3) "500"
          ["width"]=>
          string(3) "606"
        }
        ["sourceURL"]=>
        string(131) "http://di1.shopping.com/images/pi/93/bc/04/101677489-606x500-0-0.jpg?p=p2.6566ad68b022f6260efc&a=2&c=1&l=7000610&t=110528211343&r=2"
      }
    }
  }
  ["rating"]=>
  object(SimpleXMLElement)#7 (4) {
    ["reviewCount"]=>
    string(1) "5"
    ["rating"]=>
    string(4) "5.00"
    ["ratingImage"]=>
    object(SimpleXMLElement)#9 (2) {
      ["@attributes"]=>
      array(2) {
        ["height"]=>
        string(2) "18"
        ["width"]=>
        string(2) "91"
      }
      ["sourceURL"]=>
      string(48) "http://img.shopping.com/sc/pr/sdc_stars_sm_5.gif"
    }
    ["reviewURL"]=>
    string(61) "http://www.shopping.com/Nikon-D3100/reviews~linkin_id-7000610"
  }
  ["minPrice"]=>
  string(6) "519.00"
  ["maxPrice"]=>
  string(6) "712.00"
  ["productOffersURL"]=>
  string(60) "http://www.shopping.com/Nikon-D3100/prices~linkin_id-7000610"
  ["productSpecsURL"]=>
  string(58) "http://www.shopping.com/Nikon-D3100/info~linkin_id-7000610"
  ["offers"]=>
  object(SimpleXMLElement)#6 (1) {
    ["@attributes"]=>
    array(3) {
      ["matchedOfferCount"]=>
      string(2) "10"
      ["pageNumber"]=>
      string(1) "1"
      ["returnedOfferCount"]=>
      string(1) "0"
    }
  }

Any ideas? I’ve tried the following code already but it doesn’t change anything.

foreach( $xml->categories->category->items->product as $product )
{
var_dump($product);
}
foreach( $xml->categories->category->items->offer as $offer )
{
var_dump($offer);
}
  • 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-22T18:22:54+00:00Added an answer on May 22, 2026 at 6:22 pm

    Try something like:

    foreach( $xml->categories->category->items->product as $product )
    {
        echo "{$product->name} from {$product->minPrice} to {$product->maxPrice}\n";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a snippet from the XML file I am trying to parse: <Item
I have this xml snippet as part of a xml file that will be
Can someone please help me, I have this xml snippet <?xml version=1.0 encoding=utf-8 ?>
I have an XML that contains information about environment variable to set into the
I have the following snippet of XML: <?xml version=1.0 encoding=UTF-8?> <Envelope xmlns=http://schemas.microsoft.com/dynamics/2008/01/documents/Message> <Header> <MessageId>{11EA62F5-543A-4483-B216-91E526AE2319}</MessageId>
I have an .xml file that I would like to simply make more human
I'm parsing flight times in my iPhone app. Here's a snippet from the XML
I have report that I must convert to PDF using xsl-fo from xml data
Here's an XML snippet: <appSettings> <add key=val1 value=val2/> The XML document is loaded in
Here an snippet pom.xml <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.2</version> <configuration> <webappDirectory>C:/Users/Tom/Desktop</webappDirectory> </configuration> </plugin>

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.