Same XML, different type (XML Unserializer).

From: Date: Fri, 19 Mar 2004 17:47:52 +0000
Subject: Same XML, different type (XML Unserializer).
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11401@lists.php.net to get a copy of this message
Hey, I seem to be having a problem with the XML Unserializer. The XML below is exactly the same, except the above has two childs, and the bottom only one: <Authors> <Author>Seuss</Author> <Author>Theodor Seuss Geisel</Author> </Authors> <Authors> <Author>Dr. Seuss</Author> </Authors> XML Unserializer returns different datatypes though. For the above one it returns: [Authors] => Array
                (
                    [Author] => Array
                        (
                            [0] => Seuss
                            [1] => Theodor Seuss Geisel
                        )
                )
And for the bottom one: [Authors] => Array
                (
                    [Author] => Dr. Seuss
                )
As you can see this is very annoying, especially when I'm using it in combination with Smarty (I've spent an hour trying to debug this problem!). Any help on this one? Any easy solutions (which are preferably Smarty-compatible?) Thanks!

« previous php.pear.general (#11401) next »