SimpleXML - issue with getting data out of the object returned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have a basic XML document that I am grabbing with simplexml_load_string(),
here is the print_r:

SimpleXMLElement Object
(
    [Package] => SimpleXMLElement Object
        (
            [PackageID] => 804
            [PackageName] => Silver
            [BandwidthGB] => 20
            [WebStorageMB] => 5120
            [DBStorageMB] => 250
            [POPMailBoxes] => 50
            [WebStorageUnits] => 5
            [BandwidthUnits] => 1
            [DBStorageUnits] => 1
            [POPUnits] => 5
            [DomainHeaders] => 50
            [DBType] => MSSQL
            [OSType] => Windows
            [Enabled] => True
        )

    [Count] => 1
)

When I try and access $x->Package->PackageID I don't get 804, I get:

SimpleXMLElement Object
        (
            [0] => 804
        )

Could someone tell me how I just get the value 804 out of there?

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux