Ok, I have this php page that makes an searchItem request at amazon and gets back a list of products.
when i use the following code, when visiting the page I see a xml formatted page (like firefox does):
<?php
//in top of file:
header('Content-type: text/xml');
// code
// code
$response = file_get_contents($SignedRequest); //doesn't matter what signerrequest is, it works
print $response;
?>
Using this code above I get a good xml file. However I want an xml object in my php code to traverse in etc. So i try using the simplexml_load_string() function like this:
$response = file_get_contents($SignedRequest);
$xml = simplexml_load_string($response);
I now want sort of pretty print this object to see the xml structure. Some loop or something?
How can I see whether I have an xml object and what it's structure is etc. Is there some kind of prettyprint function for simplexmlobjects?
print_rshould work for SimpleXML objects