After calling the prestashop webservice, I recieved the response as shown below:
SimpleXMLElement Object
(
[order] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[id] => 1
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[id] => 2
)
)
)
)
I tried to retrive the content by looping as shown below:
foreach($resources as $resource){
echo '<pre>';
print_r($resource['id']);
echo '</pre>';
}
This gives me:
SimpleXMLElement Object
(
[0] => 1
)
SimpleXMLElement Object
(
[0] => 2
)
How can I retrieve 1 and 2 which are the values of these objects? thanks