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
https://forums.phpfreaks.com/topic/90734-simplexmlelement-disapearing-elements/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.