Link to home
Start Free TrialLog in
Avatar of James Murphy
James MurphyFlag for Australia

asked on

Simple XML data

Hi Experts!

Firstly thank you for taking a look at my question.  I am having a shocking morning and can't for the life of me work out how to get the details out of the XML data.

given this XML:

  ["soapBody"]=>
  object(SimpleXMLElement)#2 (1) {
    ["Response"]=>
    object(SimpleXMLElement)#3 (5) {
      ["@attributes"]=>
      array(2) {
        ["Version"]=>
        string(3) "1.0"
        ["Environment"]=>
        string(1) "T"
      }

How do I access the Version and Environment data?

This is what I am trying -

        $xml = new SimpleXMLElement($response);
      $consumer = $xml->xpath('//Response/Version');
      echo "<br><Br>Consumer:".$consumer;

I have worked with this before but am having a brain block this morning.

This is the current response.

Notice: Array to string conversion in C:\xampp\htdocs\illion\illion v2.php on line 55
Consumer:Array

many thanks for you help!!!
ASKER CERTIFIED SOLUTION
Avatar of James Murphy
James Murphy
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial