Ok, I have this php page that makes a searchItem request on amazon and returns a list of products.
when I use the following code, when I visit the page, I see an xml-formatted page (e.g. firefox):
<?php
header('Content-type: text/xml');
$response = file_get_contents($SignedRequest);
print $response;
?>
Using this code above, I get a good XML file. However, I want the xml object in my PHP code to go in, etc. Therefore, I am trying to use the simplexml_load_string () function as follows:
$response = file_get_contents($SignedRequest);
$xml = simplexml_load_string($response);
Now I want this object to print pretty nicely to see the xml structure. Some kind of cycle or something?
How can I see if I have an xml object and its structure, etc. Is there any printprint function for simplexmlobjects?
source
share