SimpleXML - issue with getting data out of the object returned

From: Date: Fri, 19 Dec 2008 02:50:31 +0000
Subject: SimpleXML - issue with getting data out of the object returned
Groups: php.general 
Request: Send a blank email to php-general+get-284811@lists.php.net to get a copy of this message
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."

« previous php.general (#284811) next »