1

I need parse a response xml in php, and i call the object into object, but one object have a "." or "-" in middle.

For example xml :

  [obj1]
     [obj1.1]
            Array(
                  [value]xxxxxx
             .....

In php i trying :

    $myvalue = $xml->obj1->obj1.1['value'];
    echo $myvalue;

And need a function or method or instuction for realize this call to obj1.1. Thanks, PD: sorry for my bad english...

1 Answers1

1

Access the element as follows

$myvalue = $xml->obj1->{'obj1.1'}['value'];

Originally answered here https://stackoverflow.com/a/5351141/3944304

Community
  • 1
  • 1
CT14.IT
  • 1,635
  • 1
  • 15
  • 31