I have a string that dynamically gets its value from another server. String value
$string1 = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.microsoft.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<AuthenticateUserResponse xmlns="http://microsoft.com/xml/namespace/2012/04">
<Authenticator>AE1001</Authenticator>
</AuthenticateUserResponse>
</soap:Body>
</soap:Envelope>';
My question is, as a rule, we use * $ xml = simplexml_load_file ("test1.xml"); * for loading XML files, but here, in my requirement, this is String , how can I read this String value and extract the child element of node and its value? Example:
<Authenticator> and its value "AE1001" ?
Is there a way to put this in an Array? so is it easy for me to print its node value?
Me 4u source
share