Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created November 30, 2011 19:10
Show Gist options
  • Save whyisjake/1410353 to your computer and use it in GitHub Desktop.
Save whyisjake/1410353 to your computer and use it in GitHub Desktop.
SimpleXMLElement Object
(
[Products] => Array
(
[0] => SimpleXMLElement Object
(
[AutoDropShip] => N
[DoNotAllowBackOrders] => N
[LastModBy] => 287
[LastModified] => 12/21/2010 2:18:00 PM
[ProductCode] => GFT
[ProductID] => 1
[ProductName] => Gift Certificate
[StockStatus] => 8287
[ProductDescription] => Can't decide what to get your favorite Maker, Crafter or Hacker? Give them a gift certificate good for anything from the Maker Shed with the amount you choose.
[...]
print_r($xml); //Gives me the above
$products = $xml->products;
print_r($products); // Gives me... SimpleXMLElement Object ()
foreach ($products as $product) {
echo $product->ProductName;
}
//Would think that I would get a big list of product names here...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment