Jump to content

SimpleXMLElement disapearing elements


neoform

Recommended Posts

I'm using simplexml to parse a feed..  but I'm getting a very strange and annoying problem.

 

print_r($this->Item->EditorialReviews);
print_r($this->Item->EditorialReviews->EditorialReview);

 

produces:

 

SimpleXMLElement Object
(
    [EditorialReview] => Array
        (
            [0] => SimpleXMLElement Object
                (
                    [source] => Product Description
                    [Content] => 46" widescreen HDTV (16:9 aspect ratio) * high-gloss black finish * built-in digital (ATSC) and analog (NTSC) tuners for over-the-air TV broadcasts (antenna required) * built-in QAM cable TV tuner receives unscrambled programs without a set-top box (cable service required) * Super Clear LCD panel with semi-gloss screen (1920 x 1080 pixels) *
                )

            [1] => SimpleXMLElement Object
                (
                    [source] => Amazon.com Product Description
                    [Content] => For people looking to step up to full 1080p resolution in a 46-inch flat-panel LCD, Samsung's 2007 model LNT4665F is a good choice. Besides offering full 1080p resolution the LNT4665F also features a 15,000:1 dynamic contrast ratio for rich blacks and subltle tecture display, an 8ms response time panel for smooth motion, hidden side speakers, an NTSC tuner, and 3 HDMI ports. 
) ) )

SimpleXMLElement Object
(
    [source] => Product Description
    [Content] => 46" widescreen HDTV (16:9 aspect ratio) * high-gloss black finish * built-in digital (ATSC) and analog (NTSC) tuners for over-the-air TV broadcasts (antenna required) * built-in QAM cable TV tuner receives unscrambled programs without a set-top box (cable service required) * Super Clear LCD panel with semi-gloss screen (1920 x 1080 pixels) *
)

 

Why is the second result returning an object with 1 element and not an array with 2 elements?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.